powmedia / pow-mongodb-fixtures Goto Github PK
View Code? Open in Web Editor NEWEasy JSON fixture loading for MongoDB. Makes managing relationships easier.
License: MIT License
Easy JSON fixture loading for MongoDB. Makes managing relationships easier.
License: MIT License
For the example
var users = exports.users = {
user1: {
_id: id(),
name: 'Michael'
},
user2: {
_id: id(),
name: 'George Michael',
father: users.user1._id
},
user3: {
_id: id('4ed2b809d7446b9a0e000014'),
name: 'Tobias'
}
}
Uncaught TypeError: Cannot read property 'user1' of undefined
at Object. (test/fixtures/powMongo/fixtures.js:23:22)
at _fileToObject (node_modules/pow-mongodb-fixtures/src/index.js:419:14)
at node_modules/pow-mongodb-fixtures/src/index.js:400:7
Node v4.2.4
When I use clearAndLoad to prepare test-data, it will throw Error if collection do not exist. It make sense but I think it's more friendly to give an option argument to clearAndLoad function to indicate whether to throw Error or not if collection do not exist. Actually I can help for this.
I have the following scenario-
Col A - Keep all data
Col B - Clear all and load fixture
Col C - Clear all data
Ideally I would like to specify collection C as an empty array in my fixture and then this library would clear all data from it. However I will get an error "Invalid Operation, No operations in bulk". At this point the jobs collection will not exist and subsequent operations will throw a "ns not found" error.
I think the solution would be if a fixture array is empty, create an empty collection instead of trying to insert items.
I could work around this by always dropping collection C and ignoring any errors, but this seems less than ideal.
It would be nice if load() would only load fixture files in case a directory is specified. When I edit a fixture file in VIM a .swp files is created. This makes pow-mongodb-fixtures fail.
After run of npm audit
-> it turned out that the library has 10 vulnerabilities. Could you be so kind to fix them ? :)
Seems like you upgraded to lodash a while back, but the package is still requiring underscore.
Also, the shrinkwrap is wildly outdated, and probably should be removed.
Either I missed something with createObjectId
, or there's something wrong.
When creating an id with that function, if I later try to fetch the object with that same id, it doesn't find it :
var mongo = require('mongodb')
, dbServer = new mongo.Server('localhost', mongo.Connection.DEFAULT_PORT, {auto_reconnect: true})
, dbConn = new mongo.Db('testDb', dbServer, {safe: false})
, fixtures = require('pow-mongodb-fixtures').connect('testDb')
, id = require('pow-mongodb-fixtures').createObjectId
// My fixtures with a custom id
, animals = {
dog: {
'_id': id(),
'name': 'dog'
}
};
dbConn.open(function(err, db) {
db.createCollection('animals', function(err, coll) {
// Loading the fixtures
fixtures.clearAndLoad({'animals': animals}, function() {
// Fetching the dog
coll.findOne(animals.dog._id, function(err, result) {
console.log('found using generated id : ', err, result)
coll.find({}).toArray(function(err, result) {console.log('all found : ', result)})
})
})
})
})
Hi! I use your library for unit testing my app using jasmine-node
and, whenever a unit test finished, I needed to close all MongoDB connections to ensure that jasmine-node
exits successfully, including the connection that pow-mongodb-fixtures
opens. Prior to the change on line 54 (commit 51ce8a7), I used the .db
variable to get access to the MongoDB object and call .close()
, but I'm unable to reach the object now with this change. At the line 241, you copy the interface to loader.client
, but I'm unable to reach that from within my code. So, any suggestions on how I should close the connection opened by your connect(dbName)
function?
Best Regards
fixtures.clearAndload(__dirname + '/../fixtures/file.js', done);
Results in:
TypeError: Cannot call method 'checkoutConnection' of undefined
Hello!
I'm trying to use clear
function and I haven't success. Debugging, I saw that when at line 150 (results.db.collectionNames(function(err, names)
), my object result
doesn't have collectionNames
function and I haven't code progress.
My results
object:
{ db: { domain: { domain: null, _events: [Object], _maxListeners: 10, members: [] }, _events: {}, _maxListeners: 10, s: { databaseName: 'pwtests', topology: [Object], options: [Object], logger: [Object], bson: {}, authSource: undefined, readPreference: undefined, bufferMaxEntries: -1, parentDb: null, pkFactory: undefined, nativeParser: undefined }, serverConfig: [Getter], bufferMaxEntries: [Getter], databaseName: [Getter], options: [Getter], native_parser: [Getter], slaveOk: [Getter], writeConcern: [Getter] } }
When fixtures are loaded from a file, the path isn't resolved correctly.
Here's the tests output:
index.test
✔ init
✔ createObjectId - with ID as string
✔ createObjectId - with existing ID
✔ createObjectId - without ID
TODO: Havent been able to replicate error yet:Sometimes when referencing an ID that was generated elsewhere, it gets encoded incorrectly.Test needs to fail first so it can be fixed.
✔ works when referencing an objectID in different scope - when using this
✔ add modifier
✔ load - array
✔ load - object
✖ load - file
Error: ENOENT, stat 'C:\fixtures\archer.js'
✖ load - directory - default
Error: ENOENT, stat 'C:\fixtures'
✖ load - directory - ignore sub directories
Error: ENOENT, stat 'C:\fixtures_with_subdir'
✖ load - with modifiers
Error: ENOENT, stat 'C:\fixtures\archer.js'
✖ clear - drops the db if collections not specified
Error: ENOENT, stat 'C:\fixtures'
✖ clear - clears a collection if called with a string
Error: ENOENT, stat 'C:\fixtures'
✖ clear - clears multiple collections if called with an array
Error: ENOENT, stat 'C:\fixtures'
✖ clear - clearing non-existent collections shouldnt error
Error: ENOENT, stat 'C:\fixtures'
✖ clearAllAndLoad - drops the db and loads data
Error: ENOENT, stat 'C:\fixtures'
✖ clearAndLoad - drops only referenced collections; with object data
Error: ENOENT, stat 'C:\fixtures'
✖ clearAndLoad - drops only referenced collections; with a file
Error: ENOENT, stat 'C:\fixtures'
✔ exit
FAILURES: 11/23 assertions failed (293289ms)
I encountered this issue while trying to load a file with an absolute Windows path (i.e.: C:\path\to\fixtures), it looks like the following code, which could be found multiple times in the code-base is causing an issue:
//Get the absolute dir path if a relative path was given
if (fixtures.substr(0, 1) !== '/') {
var parentPath = module.parent.filename.split('/');
parentPath.pop();
fixtures = parentPath.join('/') + '/' + fixtures;
}
I got it to work with an absolute path on Windows by changing the IF statement above (and a few similar ones) to something along those lines:
if (fixtures.substr(0, 1) !== '/' && fixtures.substr(1, 1) !== ':') {}
However, this does not resolve relative path such as './fixtures' on Windows.
I'm still looking into it, should attach a fix shortly.
About one third (sometimes more) of the time when I run clear, I get the following error:
Unhandled rejection MongoError: exception: cannot perform operation: a background operation is currently running for collection [some collection]
[some collection] is always changing. I don't have indexing or anything else running on mongodb.
node mongodb package version: 2.0.48
pow-mongodb-fixtures package version: 0.13.0
It throws the following error:
TypeError: Object [object Object] has no method 'collectionNames'
at getCollectionNames (/home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/src/index.js:156:28)
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:494:21
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:194:13
at iterate (/home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:118:13)
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:129:25
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:196:17
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:499:34
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/src/index.js:146:17
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/src/index.js:287:35
at /home/---/wonderflow/wonderboard/backend/de-en-review-translator/node_modules/pow-mongodb-fixtures/node_modules/mongodb/lib/db.js:200:5
The program is the following:
var fixtures2 = require('pow-mongodb-fixtures').connect('test', {
host: 'localhost',
port: 27017,
/* user:'test',
pass:'test'
*/
});
fixtures2.clearAllAndLoad(require('./test/data/data.js'), function(err){
console.log(err);
})
by console I can login to mongodb and read the test database.
"sails": "^1.0.0-45",
"sails-mongo": "^1.0.0-11",
"pow-mongodb-fixtures": "^0.14.0"
sails-mongo requires: "mongodb": "2.2.25",
pow-mongodb-fixtures requires: "mongodb": "~2.2.x", which will install later version like 2.2.33
This will raise 'Mongo Error: topology was destroyed' when you want to, for instance, call model.getDatastore().manager.collection(model.tableName).ensureIndex
.
Quick & dirty solution: uninstall both and install sails-mongo@beta first
Hello,
I have a project that uses an older version of this package to load test data into a replica set and I'm trying to update the project's node mongo driver version from 1.4.x to 2.2.x. When I tried updating this package to version 0.14.0 for compatibility with the newer mongo diver, all of my tests failed with mongo ns not found errors.
I tried pulling the package to try to figure out what the issue was only to find that when I symlinked the current code on master into my npm modules, the tests started working again. It appears that a commit that was merged in about 4 months ago has a fix for this issue by changing a collection.drop call to collection.deleteMany in the clearCollections function. However, when looking through the tags it appears that this fix was never published to npm, as the most recent publish happened a year ago.
Could a new version of this package be published with the current code on master to fix this issue?
For my use case, I want to be able to add some properties to my fixture data at run-time prior to it being inserted into the database. I'm thinking of adding the concept of filters to do this.
So you might do something like this:
var fixtures = require('pow-mongodb-fixtures').connect(app.db.name, app.
fixtures.addModifier(function(collectionName, doc, cb) {
doc.createdAt = new Date();
cb(null, doc);
});
fixtures.load(__dirname + '/../db/fixtures', function(err) {
The signature of the filter method:
/**
*
* @param collectionName the name of the collection to which the doc is going to be inserted.
* @param doc the doc which is going to be inserted.
* @param cb callback with signature (err, modifiedDoc)
*/
What do you think?
The phrases "drops database" and "clear collections" are used interchangeably in the Readme and in the source code, but the clear
function only does a remove
and never a drop
.
Add a new method drop
, with derivatives for dropAndLoad
, etc.
clearAllAndLoad (and probably load) is mutating objects from arguments
var fixture = { firstname: 'foo', lastname: 'bar' };
powMongoFixture.clearAllAndLoad({ users: fixture }, function () {
// fixture now has:
// "_id": {
// "_bsontype": "ObjectID"
// "id": "U9\t),�~iV\u0005�¼"
// }
Not sure if it's pow-mongo or mongodb itself. But it sux. :(
So I'm running integration (REST-API) tests with mocha & chai. Every time before the tests start I reset my database & load some sample data in it with pow-mongodb-fixtures. Like this in the beforeEach
method:
fixtures.clearAllAndLoad(__dirname + '/../migrations/data', function (err) {
if (err) {
console.log(err);
throw new Error('Database error');
} else {
done();
}
});
I load this fixture in every beforeEach
method from every test case.
I got three docker containers: 1) MongoDB container 2) Web-App container 3) Mocha-tests container
I run the tests separately after the mongodb & webapp has started up. But sometimes (every 4th time or so) I get the following error:
komed-test-integration | Uncaught Error: MongoError: cannot perform operation: a background operation is currently running for collection komed-health.users
I guess mocha tries to execute too many db fixtures at once. Does anybody know how I can tell mocha to wait to execute them after the first beforeEach method has finished?
Here is the full stack trace:
PS D:\projects\komed-health> docker-compose -f docker-compose.yml -f docker-compose.test.yml up
Starting komed-mongo
Starting komed-app
Starting komed-test-integration
Attaching to komed-mongo, komed-app, komed-test-integration
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=ede62ff72efe
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] db version v3.2.11
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] git version: 009580ad490190ba33d1c6253ebd8d91808923e4
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] allocator: tcmalloc
komed-app | npm info it worked if it ends with ok
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] modules: none
komed-app | npm info using [email protected]
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] build environment:
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] distmod: debian81
komed-app | npm info using [email protected]
komed-mongo | 2016-12-24T08:22:20.768+0000 I CONTROL [initandlisten] distarch: x86_64
komed-mongo | 2016-12-24T08:22:20.769+0000 I CONTROL [initandlisten] target_arch: x86_64
komed-mongo | 2016-12-24T08:22:20.769+0000 I CONTROL [initandlisten] options: {}
komed-mongo | 2016-12-24T08:22:20.772+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage en
gine to 'wiredTiger'.
komed-mongo | 2016-12-24T08:22:20.772+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,st
atistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
komed-mongo | 2016-12-24T08:22:21.045+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
komed-mongo | 2016-12-24T08:22:21.045+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
komed-mongo | 2016-12-24T08:22:21.046+0000 I NETWORK [initandlisten] waiting for connections on port 27017
komed-app | npm info lifecycle [email protected]~prestart: [email protected]
komed-app | npm info lifecycle [email protected]~start: [email protected]
komed-app |
komed-app | > [email protected] start /home/app
komed-app | > node ./app
komed-app |
komed-test-integration | npm info it worked if it ends with ok
komed-test-integration | npm info using [email protected]
komed-test-integration | npm info using [email protected]
komed-test-integration | npm info lifecycle [email protected]~pretest-integration: [email protected]
komed-test-integration | npm info lifecycle [email protected]~test-integration: [email protected]
komed-test-integration |
komed-test-integration | > [email protected] test-integration /home/app
komed-test-integration | > mocha --timeout 10000 --reporter spec --compilers ts:ts-node/register integration-tests/**/*.test.ts
komed-test-integration |
komed-mongo | 2016-12-24T08:22:27.685+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.3:34810 #1 (1 connection now open)
komed-mongo | 2016-12-24T08:22:27.686+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.3:34812 #2 (2 connections now open)
komed-app | Redirecting http requests from port 5000 to ssl port 5001
komed-app |
komed-test-integration |
komed-test-integration |
komed-test-integration | Home test
komed-test-integration | HEYAAA 0
komed-app | Release 0.0.1 started under env: dev
komed-app | Running under port 5001
komed-app |
komed-mongo | 2016-12-24T08:22:28.169+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.3:34816 #3 (3 connections now open)
komed-mongo | 2016-12-24T08:22:28.169+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.3:34818 #4 (4 connections now open)
komed-mongo | 2016-12-24T08:22:28.169+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.3:34820 #5 (5 connections now open)
komed-mongo | 2016-12-24T08:22:28.170+0000 I INDEX [conn1] build index on: komed-health.sessions properties: { v: 1, key: { expires: 1 }, name: "expires_1", ns: "komed-health.
sessions", expireAfterSeconds: 0 }
komed-mongo | 2016-12-24T08:22:28.178+0000 I INDEX [conn1] building index using bulk method
komed-mongo | 2016-12-24T08:22:28.184+0000 I INDEX [conn1] build index done. scanned 1 total records. 0 secs
komed-mongo | 2016-12-24T08:22:28.224+0000 I INDEX [conn2] build index on: komed-health.messages properties: { v: 1, key: { posted: 1 }, name: "posted_1", ns: "komed-health.me
ssages", background: true }
komed-mongo | 2016-12-24T08:22:28.224+0000 I INDEX [conn2] build index done. scanned 0 total records. 0 secs
komed-app | GET / 200 14.134 ms - 2437
komed-test-integration | Γ£ô should responds with initial web page
komed-app | GET / 200 4.713 ms - 2437
komed-test-integration |
komed-test-integration | i18n test
komed-mongo | 2016-12-24T08:22:28.287+0000 I INDEX [conn2] build index on: komed-health.rooms properties: { v: 1, unique: true, key: { slug: 1 }, name: "slug_1", ns: "komed-he
alth.rooms", background: true }
komed-mongo | 2016-12-24T08:22:28.287+0000 I INDEX [conn2] build index done. scanned 0 total records. 0 secs
komed-app | GET /app/en-lang.json 200 13.018 ms - 90
komed-test-integration | Γ£ô should respond with success when getting app translations (42ms)
komed-mongo | 2016-12-24T08:22:28.314+0000 I INDEX [conn2] build index on: komed-health.users properties: { v: 1, unique: true, key: { email: 1 }, name: "email_1", ns: "komed-
health.users", background: true }
komed-mongo | 2016-12-24T08:22:28.329+0000 I INDEX [conn4] build index on: komed-health.messages properties: { v: 1, key: { _fts: "text", _ftsx: 1, room: 1, posted: -1, _id: 1
}, name: "text_text_room_1_posted_-1__id_1", ns: "komed-health.messages", background: true, weights: { text: 1 }, default_language: "english", language_override: "language", textIndexVersion:
3 }
komed-mongo | 2016-12-24T08:22:28.329+0000 I INDEX [conn4] build index done. scanned 0 total records. 0 secs
komed-mongo | 2016-12-24T08:22:28.329+0000 I INDEX [conn2] build index done. scanned 2 total records. 0 secs
komed-app | GET /auth/en-lang.json 200 11.611 ms - 893
komed-test-integration | Γ£ô should respond with success when getting auth translations
komed-test-integration |
komed-test-integration | Account test
komed-mongo | 2016-12-24T08:22:28.348+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37948 #6 (6 connections now open)
komed-mongo | 2016-12-24T08:22:28.382+0000 I INDEX [conn2] build index on: komed-health.usermessages properties: { v: 1, key: { posted: 1 }, name: "posted_1", ns: "komed-healt
h.usermessages", expireAfterSeconds: 21600, background: true }
komed-mongo | 2016-12-24T08:22:28.383+0000 I INDEX [conn2] build index done. scanned 0 total records. 0 secs
komed-mongo | 2016-12-24T08:22:28.396+0000 I COMMAND [conn6] CMD: drop komed-health.messages
komed-mongo | 2016-12-24T08:22:28.398+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37950 #7 (7 connections now open)
komed-mongo | 2016-12-24T08:22:28.399+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37952 #8 (8 connections now open)
komed-mongo | 2016-12-24T08:22:28.400+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37954 #9 (9 connections now open)
komed-mongo | 2016-12-24T08:22:28.400+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37956 #10 (10 connections now open)
komed-mongo | 2016-12-24T08:22:28.402+0000 I INDEX [conn2] build index on: komed-health.users properties: { v: 1, unique: true, key: { username: 1 }, name: "username_1", ns: "
komed-health.users", background: true }
komed-mongo | 2016-12-24T08:22:28.427+0000 I COMMAND [conn6] CMD: drop komed-health.users
komed-mongo | 2016-12-24T08:22:28.429+0000 I INDEX [conn2] build index done. scanned 2 total records. 0 secs
komed-mongo | 2016-12-24T08:22:28.449+0000 I INDEX [conn4] build index on: komed-health.usermessages properties: { v: 1, key: { users: 1, posted: -1, _id: 1 }, name: "users_1_
posted_-1__id_1", ns: "komed-health.usermessages", background: true }
komed-mongo | 2016-12-24T08:22:28.450+0000 I COMMAND [conn6] CMD: drop komed-health.sessions
komed-mongo | 2016-12-24T08:22:28.454+0000 I INDEX [conn4] build index done. scanned 0 total records. 0 secs
komed-mongo | 2016-12-24T08:22:28.483+0000 I COMMAND [conn6] CMD: drop komed-health.rooms
komed-test-integration | 1) "before each" hook: setup database
komed-test-integration |
komed-test-integration | Account test
komed-mongo | 2016-12-24T08:22:28.498+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37958 #11 (11 connections now open)
komed-mongo | 2016-12-24T08:22:28.507+0000 I COMMAND [conn6] CMD: drop komed-health.usermessages
komed-mongo | 2016-12-24T08:22:28.512+0000 I COMMAND [conn11] CMD: drop komed-health.users
komed-mongo | 2016-12-24T08:22:28.513+0000 I NETWORK [initandlisten] connection accepted from 172.18.0.4:37960 #12 (12 connections now open)
komed-mongo | 2016-12-24T08:22:28.550+0000 I COMMAND [conn11] CMD: drop komed-health.usermessages
komed-test-integration | { MongoError: ns not found
komed-test-integration | at Function.MongoError.create (/home/app/node_modules/mongodb-core/lib/error.js:31:11)
komed-test-integration | at /home/app/node_modules/mongodb-core/lib/connection/pool.js:483:72
komed-test-integration | at authenticateStragglers (/home/app/node_modules/mongodb-core/lib/connection/pool.js:429:16)
komed-test-integration | at Connection.messageHandler (/home/app/node_modules/mongodb-core/lib/connection/pool.js:463:5)
komed-test-integration | at Socket.<anonymous> (/home/app/node_modules/mongodb-core/lib/connection/connection.js:317:22)
komed-test-integration | at emitOne (events.js:96:13)
komed-test-integration | at Socket.emit (events.js:188:7)
komed-test-integration | at readableAddChunk (_stream_readable.js:176:18)
komed-test-integration | at Socket.Readable.push (_stream_readable.js:134:10)
komed-test-integration | at TCP.onread (net.js:548:20)
komed-test-integration | name: 'MongoError',
komed-test-integration | message: 'ns not found',
komed-test-integration | ok: 0,
komed-test-integration | errmsg: 'ns not found',
komed-test-integration | code: 26 }
komed-test-integration | 2) "before each" hook: setup database
komed-test-integration |
komed-test-integration |
komed-test-integration | 3 passing (741ms)
komed-test-integration | 2 failing
komed-test-integration |
komed-test-integration | 1) Account test "before each" hook: setup database:
komed-test-integration | Uncaught Error: MongoError: cannot perform operation: a background operation is currently running for collection komed-health.users
komed-test-integration | at integration-tests/login.test.ts:24:23
komed-test-integration | at node_modules/pow-mongodb-fixtures/src/index.js:215:21
komed-test-integration | at node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:99:21
komed-test-integration | at handleCallback (node_modules/mongodb/lib/utils.js:95:56)
komed-test-integration | at node_modules/mongodb/lib/db.js:838:20
komed-test-integration | at handleCallback (node_modules/mongodb/lib/utils.js:95:56)
komed-test-integration | at node_modules/mongodb/lib/db.js:311:20
komed-test-integration | at node_modules/mongodb-core/lib/connection/pool.js:455:18
komed-test-integration | at _combinedTickCallback (internal/process/next_tick.js:67:7)
komed-test-integration | at process._tickCallback (internal/process/next_tick.js:98:9)
komed-test-integration |
komed-test-integration | 2) Account test "before each" hook: setup database:
komed-test-integration | Uncaught Error: Database error
komed-test-integration | at integration-tests/register.test.ts:24:23
komed-test-integration | at node_modules/pow-mongodb-fixtures/src/index.js:215:21
komed-test-integration | at node_modules/pow-mongodb-fixtures/node_modules/async/lib/async.js:99:21
komed-test-integration | at handleCallback (node_modules/mongodb/lib/utils.js:95:56)
komed-test-integration | at node_modules/mongodb/lib/db.js:838:20
komed-test-integration | at handleCallback (node_modules/mongodb/lib/utils.js:95:56)
komed-test-integration | at node_modules/mongodb/lib/db.js:311:20
komed-test-integration | at node_modules/mongodb-core/lib/connection/pool.js:455:18
komed-test-integration | at _combinedTickCallback (internal/process/next_tick.js:67:7)
komed-test-integration | at process._tickCallback (internal/process/next_tick.js:98:9)
komed-test-integration |
komed-test-integration |
komed-test-integration |
komed-mongo | 2016-12-24T08:22:28.578+0000 I NETWORK [conn11] end connection 172.18.0.4:37958 (11 connections now open)
komed-mongo | 2016-12-24T08:22:28.578+0000 I NETWORK [conn7] end connection 172.18.0.4:37950 (11 connections now open)
komed-mongo | 2016-12-24T08:22:28.578+0000 I NETWORK [conn9] end connection 172.18.0.4:37954 (11 connections now open)
komed-mongo | 2016-12-24T08:22:28.579+0000 I NETWORK [conn10] end connection 172.18.0.4:37956 (10 connections now open)
komed-mongo | 2016-12-24T08:22:28.579+0000 I NETWORK [conn8] end connection 172.18.0.4:37952 (8 connections now open)
komed-mongo | 2016-12-24T08:22:28.579+0000 I NETWORK [conn12] end connection 172.18.0.4:37960 (6 connections now open)
komed-mongo | 2016-12-24T08:22:28.580+0000 I NETWORK [conn6] end connection 172.18.0.4:37948 (5 connections now open)
komed-test-integration |
komed-test-integration | npm info lifecycle [email protected]~test-integration: Failed to exec test-integration script
komed-test-integration | npm ERR! Linux 4.4.39-moby
komed-test-integration | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test-integration"
komed-test-integration | npm ERR! node v6.9.2
komed-test-integration | npm ERR! npm v3.10.9
komed-test-integration | npm ERR! code ELIFECYCLE
komed-test-integration | npm ERR! [email protected] test-integration: `mocha --timeout 10000 --reporter spec --compilers ts:ts-node/register integration-tests/**/*.test.ts`
komed-test-integration | npm ERR! Exit status 2
komed-test-integration | npm ERR!
komed-test-integration | npm ERR! Failed at the [email protected] test-integration script 'mocha --timeout 10000 --reporter spec --compilers ts:ts-node/register integration-tests/**/*.test
.ts'.
komed-test-integration | npm ERR! Make sure you have the latest version of node.js and npm installed.
komed-test-integration | npm ERR! If you do, this is most likely a problem with the komed-health package,
komed-test-integration | npm ERR! not with npm itself.
komed-test-integration | npm ERR! Tell the author that this fails on your system:
komed-test-integration | npm ERR! mocha --timeout 10000 --reporter spec --compilers ts:ts-node/register integration-tests/**/*.test.ts
komed-test-integration | npm ERR! You can get information on how to open an issue for this project with:
komed-test-integration | npm ERR! npm bugs komed-health
komed-test-integration | npm ERR! Or if that isn't available, you can get their info via:
komed-test-integration | npm ERR! npm owner ls komed-health
komed-test-integration | npm ERR! There is likely additional logging output above.
komed-test-integration |
komed-test-integration | npm ERR! Please include the following file with any support request:
komed-test-integration | npm ERR! /home/app/npm-debug.log
komed-test-integration exited with code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.