Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
"prebootstrap": "npm install",
"bootstrap": "lerna bootstrap",
"clean": "lerna clean -y && rm -Rf node_modules",
"check": "echo",
"check-ci": "echo",
"lint": "lerna run check --since HEAD --exclude-dependents",
"check": "lerna run check --since HEAD --exclude-dependents",
"check-ci": "lerna run check",
"test": "lerna run test",
"test-ci": "lerna run test-ci",
"compile-ts": "lerna run compile-ts",
"start-async": "lerna exec npm run start-async --scope @mongosh/cli-repl",
"compile-cli": "lerna run compile-ts --scope @mongosh/cli-repl --include-dependencies",
"prestart-cli": "npm run compile-cli",
"start-cli": "lerna exec npm start --scope @mongosh/cli-repl",
Expand Down
13 changes: 0 additions & 13 deletions packages/browser-repl/src/components/utils/inspect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,6 @@ describe('inspect', () => {
inspect(undefined)
).to.equal('undefined');
});

it.skip('inspects Symbol', () => {
expect(
inspect(Symbol('123'))
).to.equal('Symbol(123)');
});

it.skip('inspects BigInt', () => {
expect(
// eslint-disable-next-line no-undef
inspect(BigInt(1))
).to.equal('1n');
});
});

context('with BSON types', () => {
Expand Down
36 changes: 19 additions & 17 deletions packages/browser-runtime-core/src/interpreter/interpreter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,25 @@ describe('Interpreter', () => {
).to.equal(3);
});

it.skip('can redeclare a top level function as function', async() => {
expect(
await testEvaluate(
'function f() { return 1; }',
'function f() { return 2; }',
'f()'
)
).to.equal(2);
});

it.skip('can redeclare a top level function as var', async() => {
expect(
await testEvaluate(
'function sum(a, b) { return a + b; }',
'var sum = 1'
)
).to.equal(1);
describe.skip('redeclare top level vars', () => {
it('can redeclare a top level function as function', async() => {
expect(
await testEvaluate(
'function f() { return 1; }',
'function f() { return 2; }',
'f()'
)
).to.equal(2);
});

it('can redeclare a top level function as var', async() => {
expect(
await testEvaluate(
'function sum(a, b) { return a + b; }',
'var sum = 1'
)
).to.equal(1);
});
});

it('cannot re-declare a top level function as let', async() => {
Expand Down
4 changes: 4 additions & 0 deletions packages/build/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
lib
coverage

1 change: 1 addition & 0 deletions packages/build/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../config/eslintrc.base');
1 change: 1 addition & 0 deletions packages/cli-repl/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
bin
lib
dist
10 changes: 0 additions & 10 deletions packages/cli-repl/src/arg-mapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ describe('arg-mapper.mapCliToDriver', () => {
});
});

context('when cli args have disableImplicitSessions', () => {
const cliOptions: CliOptions = { disableImplicitSessions: true };

it.skip('maps to explicitlyIgnoreSession', () => {
expect(mapCliToDriver(cliOptions)).to.deep.equal({
explicitlyIgnoreSession: true
});
});
});

context('when cli args have quiet', () => {
const cliOptions: CliOptions = { quiet: true };

Expand Down
2 changes: 2 additions & 0 deletions packages/i18n/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
lib
1 change: 1 addition & 0 deletions packages/i18n/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../config/eslintrc.base');
4 changes: 3 additions & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"compile-ts": "tsc -p tsconfig.json",
"prepublish": "npm run compile-ts",
"test": "mocha --timeout 60000 --colors -r ts-node/register \"./src/**/*.spec.ts\"",
"test-ci": "mocha --timeout 60000 -r ts-node/register \"./src/**/*.spec.ts\""
"test-ci": "mocha --timeout 60000 -r ts-node/register \"./src/**/*.spec.ts\"",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"check": "npm run lint"
},
"license": "Apache-2.0",
"publishConfig": {
Expand Down
3 changes: 1 addition & 2 deletions packages/i18n/src/catalog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
interface Catalog {
export default interface Catalog {
[prop: string]: any;
}

export default Catalog;
2 changes: 1 addition & 1 deletion packages/i18n/src/translator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('Translator', () => {
});

context('when the key uses object notation', () => {
const translator = new Translator({ test: { test: 'value' }});
const translator = new Translator({ test: { test: 'value' } });

context('when the key is found', () => {
it('returns the translation', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/i18n/src/translator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/camelcase */
import Mustache from 'mustache';
import Catalog from './catalog';
import en_US from './locales/en_US';
Expand Down Expand Up @@ -60,7 +61,7 @@ class Translator {
*
* @param {string} locale - The locale.
*/
setLocale(locale: string) {
setLocale(locale: string): void {
if (MAPPINGS.hasOwnProperty(locale)) {
this.locale = locale;
this.catalog = MAPPINGS[locale];
Expand Down Expand Up @@ -100,7 +101,7 @@ class Translator {
return Mustache.render(TEMPLATE, value);
}

private find(key) {
private find(key): any {
return key.split('.').reduce((a, b) => {
return a ? a[b] : undefined;
}, this.catalog);
Expand Down
4 changes: 4 additions & 0 deletions packages/service-provider-browser/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
lib
coverage

1 change: 1 addition & 0 deletions packages/service-provider-browser/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../config/eslintrc.base');
4 changes: 3 additions & 1 deletion packages/service-provider-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"compile-ts": "tsc -p tsconfig.json",
"test": "karma start --colors",
"test-ci": "karma start --colors",
"prepublish": "npm run compile-ts"
"prepublish": "npm run compile-ts",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"check": "npm run lint"
},
"license": "Apache-2.0",
"publishConfig": {
Expand Down
4 changes: 1 addition & 3 deletions packages/service-provider-browser/src/stitch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* Defines behaviour common to both the Stitch server and browser
* client APIs.
*/
interface StitchClient {
export default interface StitchClient {
auth: any;
}

export default StitchClient;
3 changes: 1 addition & 2 deletions packages/service-provider-browser/src/stitch-mongo-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
* Defines behaviour common to both the Stitch server and browser
* mongo client APIs.
*/
interface StitchMongoClient {
export default interface StitchMongoClient {
db(name: string): any;
}

export default StitchMongoClient;
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('StitchServiceProviderBrowser [ integration ]', function() {

before(async() => {
stitchTransport = await StitchServiceProviderBrowser.fromAppId(stitchAppId, serviceName);
// eslint-disable-next-line @typescript-eslint/camelcase
testScope = { testId: testId, owner_id: stitchTransport.userId };
});

Expand All @@ -35,22 +36,14 @@ describe('StitchServiceProviderBrowser [ integration ]', function() {

beforeEach(async() => {
result = await stitchTransport.
aggregate('music', 'bands', [{ $match: { ...testScope, name: 'Aphex Twin' }}]);
aggregate('music', 'bands', [{ $match: { ...testScope, name: 'Aphex Twin' } }]);
});

it('executes the command and resolves the result', async() => {
const docs = await result.toArray();
expect(docs).to.deep.equal([]);
});
});

context('when running against a database', () => {
it.skip('it rejects the action', () => {
return stitchTransport.aggregate('admin', null, [{ $currentOp: {}}]).catch((err) => {
expect(err).to.not.equal(null);
});
});
});
});

describe('#bulkWrite', () => {
Expand Down Expand Up @@ -181,7 +174,7 @@ describe('StitchServiceProviderBrowser [ integration ]', function() {

beforeEach(async() => {
const filter = { ...testScope, name: 'Aphex Twin' };
const update = { $set: { name: 'Richard James' }};
const update = { $set: { name: 'Richard James' } };

result = await stitchTransport.
findOneAndUpdate('music', 'bands', filter, update);
Expand Down Expand Up @@ -253,7 +246,7 @@ describe('StitchServiceProviderBrowser [ integration ]', function() {

beforeEach(async() => {
const filter = { ...testScope, name: 'Aphex Twin' };
const update = { $set: { name: 'Richard James' }};
const update = { $set: { name: 'Richard James' } };

result = await stitchTransport.
updateMany('music', 'bands', filter, update);
Expand All @@ -271,7 +264,7 @@ describe('StitchServiceProviderBrowser [ integration ]', function() {

beforeEach(async() => {
const filter = { ...testScope, name: 'Aphex Twin' };
const update = { $set: { name: 'Richard James' }};
const update = { $set: { name: 'Richard James' } };

result = await stitchTransport.
updateOne('music', 'bands', filter, update);
Expand Down
Loading