Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storyous/common-utils

Package Overview
Dependencies
Maintainers
5
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storyous/common-utils - npm Package Compare versions

Comparing version 10.5.0 to 11.0.0

lib/testUtils.js

2

package.json
{
"name": "@storyous/common-utils",
"version": "10.5.0",
"version": "11.0.0",
"description": "Common utils for storyous microservices",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -36,3 +36,31 @@ # Common JS utils

### 11.0
apiTestUtil becomes testUtils. New usage:
#### `config/testing.config.json`
```javascript
const testUtils = require('@storyous/common-utils/lib/testUtils');
module.exports = {
dbUri: testUtils.uniqueDatabase(process.env.MONGODB_URI) // this will generate timestamp-postfixed database name
|| 'mongodb://127.0.0.1:27018/myProjectTesting',
// ...the rest of the config
};
```
#### `test/api.js`
```javascript
const testUtils = require('@storyous/common-utils/lib/testUtils');
const app = require('../app'); // this has to be a function providing Koa function
const config = require('../config');
testUtils.init({
app,
cleanDatabaseUrl: config.db.url // this will prune all old testing databases
});
module.exports = testUtils;
```
## MongoCachedFetcher

@@ -39,0 +67,0 @@

'use strict';
const { after } = require('mocha');
const db = require('../lib/models/db');
const { after } = require('mocha');

@@ -6,0 +6,0 @@ let connectPromise;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc