Skip to content

Commit

Permalink
test: skip child_process test in Deno, explicitly exit when tests are…
Browse files Browse the repository at this point in the history
… done re: #9056
  • Loading branch information
vkarpov15 committed Sep 5, 2022
1 parent f89f833 commit 5045b5b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"license": "MIT",
"dependencies": {
"bson": "^4.6.5",
"bson": "^4.7.0",
"kareem": "2.4.1",
"mongodb": "4.9.1",
"mpath": "0.9.0",
Expand Down
1 change: 1 addition & 0 deletions test/deno.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ for (const file of files) {

mocha.run(function(failures) {
process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures
process.exit(process.exitCode);
});
5 changes: 5 additions & 0 deletions test/errors.validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ describe('ValidationError', function() {

describe('when user code defines a r/o Error#toJSON', function() {
it('should not fail', function(done) {
if (typeof Deno !== 'undefined') {
// Deno doesn't support child_process.fork
return this.skip();
}

const err = [];
const child = require('child_process')
.fork('./test/isolated/project-has-error.toJSON.js', ['--no-warnings'], { silent: true });
Expand Down
1 change: 0 additions & 1 deletion test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,6 @@ describe('Query', function() {
const userSchema = Schema({ token: String });
const User = db.model('Test', userSchema);


const original = await User.create({ token: 'rightToken' });
let doc = await User.findOne({ token: 'wrongToken', _bsontype: 'a' });
assert.ok(!doc);
Expand Down

0 comments on commit 5045b5b

Please sign in to comment.