Skip to content

Commit

Permalink
fix: lint and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Nov 28, 2022
1 parent d7f1069 commit 6a96318
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
16 changes: 1 addition & 15 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,7 @@ nvm use --lts

set -o xtrace



# setup npm cache in a local directory
cat <<EOT > .npmrc
devdir=${NPM_CACHE_DIR}/.node-gyp
init-module=${NPM_CACHE_DIR}/.npm-init.js
cache=${NPM_CACHE_DIR}
tmp=${NPM_TMP_DIR}
registry=https://registry.npmjs.org
EOT

# install node dependencies
# npm prepare runs after install and will compile the library
# TODO(NODE-3555): rollup dependencies for node polyfills have broken peerDeps. We can remove this flag once we've removed them.
npm install --legacy-peer-deps
npm install

set +o xtrace
echo "Running: nvm use ${NODE_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion test/node/bson_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { assertBuffersEqual, isBufferOrUint8Array } = require('./tools/utils');
const { inspect } = require('util');

let OldBSON = require('bson_legacy');
OldBSON = { ...OldBSON, ...OldBSON.prototype }
OldBSON = { ...OldBSON, ...OldBSON.prototype };
const OldObjectID = OldBSON.ObjectID;

/**
Expand Down
18 changes: 11 additions & 7 deletions test/node/extended_json_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const BSONSymbol = BSON.BSONSymbol;
const Timestamp = BSON.Timestamp;

let OldBSON = require('bson_legacy');
OldBSON = { ...OldBSON, ...OldBSON.prototype }
OldBSON = { ...OldBSON, ...OldBSON.prototype };
const OldObjectID = OldBSON.ObjectID;
const usingOldBSON = true;

Expand Down Expand Up @@ -366,14 +366,14 @@ describe('Extended JSON', function () {

// Old deserializer needs `copy` to exist
newBsonObject.decimal128.bytes.copy = function (buffer, offset, start, end) {
return buffer.set(this.subarray(start, end), offset)
}
return buffer.set(this.subarray(start, end), offset);
};
newBsonObject.objectId.id.copy = function (buffer, offset, start, end) {
return buffer.set(this.subarray(start, end), offset)
}
return buffer.set(this.subarray(start, end), offset);
};
newBsonObject.objectID.id.copy = function (buffer, offset, start, end) {
return buffer.set(this.subarray(start, end), offset)
}
return buffer.set(this.subarray(start, end), offset);
};

const bsonBuffers = {
oldObjectOldSerializer: OldBSON.serialize(oldBsonObject, serializationOptions),
Expand All @@ -382,6 +382,10 @@ describe('Extended JSON', function () {
newObjectNewSerializer: BSON.serialize(newBsonObject, serializationOptions)
};

delete newBsonObject.decimal128.bytes.copy;
delete newBsonObject.objectId.id.copy;
delete newBsonObject.objectID.id.copy;

const expectedBufferBase64 =
'VgEAAAViaW5hcnkAQAAAAAAAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/DWNvZGUADgAAAGZ1bmN0aW9uKCkge30AA2RiUmVmACwAAAACJHJlZgAGAAAAdGVzdHMAECRpZAABAAAAAiRkYgAFAAAAdGVzdAAAE2RlY2ltYWwxMjgA//837RjxE6AdAgAAAABAMAFkb3VibGUAMzMzMzMzJEAQaW50MzIACgAAABJsb25nAP//38RiSvoQf21heEtleQAHb2JqZWN0SWQAERERERERERERERERB29iamVjdElEABEREREREREREREREQtic29uUmVnRXhwAGhlbGxvIHdvcmxkAGkADnN5bWJvbAAHAAAAc3ltYm9sABF0aW1lc3RhbXAAAAAAAAAAAAAA';
const expectedBuffer = Buffer.from(expectedBufferBase64, 'base64');
Expand Down

0 comments on commit 6a96318

Please sign in to comment.