@mongosh/node-runtime-worker-thread 1.8.2 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,257 @@
3
3
  * http://github.com/janl/mustache.js
4
4
  */
5
5
 
6
+ /*!
7
+ * accepts
8
+ * Copyright(c) 2014 Jonathan Ong
9
+ * Copyright(c) 2015 Douglas Christopher Wilson
10
+ * MIT Licensed
11
+ */
12
+
13
+ /*!
14
+ * body-parser
15
+ * Copyright(c) 2014 Jonathan Ong
16
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
17
+ * MIT Licensed
18
+ */
19
+
20
+ /*!
21
+ * body-parser
22
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
23
+ * MIT Licensed
24
+ */
25
+
26
+ /*!
27
+ * bytes
28
+ * Copyright(c) 2012-2014 TJ Holowaychuk
29
+ * Copyright(c) 2015 Jed Watson
30
+ * MIT Licensed
31
+ */
32
+
33
+ /*!
34
+ * content-disposition
35
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
36
+ * MIT Licensed
37
+ */
38
+
39
+ /*!
40
+ * content-type
41
+ * Copyright(c) 2015 Douglas Christopher Wilson
42
+ * MIT Licensed
43
+ */
44
+
45
+ /*!
46
+ * cookie
47
+ * Copyright(c) 2012-2014 Roman Shtylman
48
+ * Copyright(c) 2015 Douglas Christopher Wilson
49
+ * MIT Licensed
50
+ */
51
+
52
+ /*!
53
+ * depd
54
+ * Copyright(c) 2014-2018 Douglas Christopher Wilson
55
+ * MIT Licensed
56
+ */
57
+
58
+ /*!
59
+ * destroy
60
+ * Copyright(c) 2014 Jonathan Ong
61
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
62
+ * MIT Licensed
63
+ */
64
+
65
+ /*!
66
+ * ee-first
67
+ * Copyright(c) 2014 Jonathan Ong
68
+ * MIT Licensed
69
+ */
70
+
71
+ /*!
72
+ * encodeurl
73
+ * Copyright(c) 2016 Douglas Christopher Wilson
74
+ * MIT Licensed
75
+ */
76
+
77
+ /*!
78
+ * escape-html
79
+ * Copyright(c) 2012-2013 TJ Holowaychuk
80
+ * Copyright(c) 2015 Andreas Lubbe
81
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
82
+ * MIT Licensed
83
+ */
84
+
85
+ /*!
86
+ * etag
87
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
88
+ * MIT Licensed
89
+ */
90
+
91
+ /*!
92
+ * express
93
+ * Copyright(c) 2009-2013 TJ Holowaychuk
94
+ * Copyright(c) 2013 Roman Shtylman
95
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
96
+ * MIT Licensed
97
+ */
98
+
99
+ /*!
100
+ * express
101
+ * Copyright(c) 2009-2013 TJ Holowaychuk
102
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
103
+ * MIT Licensed
104
+ */
105
+
106
+ /*!
107
+ * finalhandler
108
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
109
+ * MIT Licensed
110
+ */
111
+
112
+ /*!
113
+ * forwarded
114
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
115
+ * MIT Licensed
116
+ */
117
+
118
+ /*!
119
+ * fresh
120
+ * Copyright(c) 2012 TJ Holowaychuk
121
+ * Copyright(c) 2016-2017 Douglas Christopher Wilson
122
+ * MIT Licensed
123
+ */
124
+
125
+ /*!
126
+ * http-errors
127
+ * Copyright(c) 2014 Jonathan Ong
128
+ * Copyright(c) 2016 Douglas Christopher Wilson
129
+ * MIT Licensed
130
+ */
131
+
132
+ /*!
133
+ * media-typer
134
+ * Copyright(c) 2014 Douglas Christopher Wilson
135
+ * MIT Licensed
136
+ */
137
+
138
+ /*!
139
+ * merge-descriptors
140
+ * Copyright(c) 2014 Jonathan Ong
141
+ * Copyright(c) 2015 Douglas Christopher Wilson
142
+ * MIT Licensed
143
+ */
144
+
145
+ /*!
146
+ * methods
147
+ * Copyright(c) 2013-2014 TJ Holowaychuk
148
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
149
+ * MIT Licensed
150
+ */
151
+
152
+ /*!
153
+ * mime-db
154
+ * Copyright(c) 2014 Jonathan Ong
155
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
156
+ * MIT Licensed
157
+ */
158
+
159
+ /*!
160
+ * mime-types
161
+ * Copyright(c) 2014 Jonathan Ong
162
+ * Copyright(c) 2015 Douglas Christopher Wilson
163
+ * MIT Licensed
164
+ */
165
+
166
+ /*!
167
+ * negotiator
168
+ * Copyright(c) 2012 Federico Romero
169
+ * Copyright(c) 2012-2014 Isaac Z. Schlueter
170
+ * Copyright(c) 2015 Douglas Christopher Wilson
171
+ * MIT Licensed
172
+ */
173
+
174
+ /*!
175
+ * on-finished
176
+ * Copyright(c) 2013 Jonathan Ong
177
+ * Copyright(c) 2014 Douglas Christopher Wilson
178
+ * MIT Licensed
179
+ */
180
+
181
+ /*!
182
+ * parseurl
183
+ * Copyright(c) 2014 Jonathan Ong
184
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
185
+ * MIT Licensed
186
+ */
187
+
188
+ /*!
189
+ * proxy-addr
190
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
191
+ * MIT Licensed
192
+ */
193
+
194
+ /*!
195
+ * range-parser
196
+ * Copyright(c) 2012-2014 TJ Holowaychuk
197
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
198
+ * MIT Licensed
199
+ */
200
+
201
+ /*!
202
+ * raw-body
203
+ * Copyright(c) 2013-2014 Jonathan Ong
204
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
205
+ * MIT Licensed
206
+ */
207
+
208
+ /*!
209
+ * send
210
+ * Copyright(c) 2012 TJ Holowaychuk
211
+ * Copyright(c) 2014-2022 Douglas Christopher Wilson
212
+ * MIT Licensed
213
+ */
214
+
215
+ /*!
216
+ * serve-static
217
+ * Copyright(c) 2010 Sencha Inc.
218
+ * Copyright(c) 2011 TJ Holowaychuk
219
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
220
+ * MIT Licensed
221
+ */
222
+
223
+ /*!
224
+ * statuses
225
+ * Copyright(c) 2014 Jonathan Ong
226
+ * Copyright(c) 2016 Douglas Christopher Wilson
227
+ * MIT Licensed
228
+ */
229
+
230
+ /*!
231
+ * toidentifier
232
+ * Copyright(c) 2016 Douglas Christopher Wilson
233
+ * MIT Licensed
234
+ */
235
+
236
+ /*!
237
+ * type-is
238
+ * Copyright(c) 2014 Jonathan Ong
239
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
240
+ * MIT Licensed
241
+ */
242
+
243
+ /*!
244
+ * unpipe
245
+ * Copyright(c) 2015 Douglas Christopher Wilson
246
+ * MIT Licensed
247
+ */
248
+
249
+ /*!
250
+ * vary
251
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
252
+ * MIT Licensed
253
+ */
254
+
255
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
256
+
6
257
  /**
7
258
  * @license
8
259
  * Lodash <https://lodash.com/>
@@ -1 +1 @@
1
- {"version":3,"file":"worker-runtime.js","sourceRoot":"","sources":["../src/worker-runtime.ts"],"names":[],"mappings":";;AAGA,mDAA0D;AAM1D,gFAAoE;AAEpE,8EAE0C;AAC1C,+BAAgD;AAChD,6CAAoF;AAEpF,iCAAwC;AACxC,6CAAgE;AAIhE,IAAI,CAAC,2BAAU,IAAI,6BAAY,EAAE;IAC/B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;CACvE;AAED,IAAI,OAAO,GAAmB,IAAI,CAAC;AACnC,IAAI,QAAQ,GAA2B,IAAI,CAAC;AAE5C,MAAM,cAAc,GAAG,IAAI,WAAI,EAAE,CAAC;AAElC,SAAS,aAAa,CAAC,UAAkB;IACvC,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,eAAe,UAAU,oCAAoC,CAC9D,CAAC;KACH;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAMD,MAAM,kBAAkB,GA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SAAS;QACP,OAAO,cAAc,CAAC,MAAM,EAAE,CAAC;IACjC,CAAC;CACF,CAAC;AAMF,2BAAU,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;AAE/B,IAAA,eAAS,EAAC,aAAa,EAAE,2BAAU,CAAC,CAAC;AAErC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;IACpB,IAAI,2BAAU,EAAE;QACd,2BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KACjC;AACH,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/node-runtime-worker-thread",
3
- "version": "1.8.2",
3
+ "version": "1.9.1",
4
4
  "description": "MongoDB shell runtime that lives in a worker thread",
5
5
  "homepage": "https://github.com/mongodb-js/mongosh",
6
6
  "license": "Apache-2.0",
@@ -28,11 +28,11 @@
28
28
  "prepublish": "npm run webpack-build"
29
29
  },
30
30
  "devDependencies": {
31
- "@mongosh/browser-runtime-core": "1.8.2",
32
- "@mongosh/browser-runtime-electron": "1.8.2",
33
- "@mongosh/service-provider-core": "1.8.2",
34
- "@mongosh/service-provider-server": "1.8.2",
35
- "@mongosh/types": "1.8.2",
31
+ "@mongosh/browser-runtime-core": "1.9.1",
32
+ "@mongosh/browser-runtime-electron": "1.9.1",
33
+ "@mongosh/service-provider-core": "1.9.1",
34
+ "@mongosh/service-provider-server": "1.9.1",
35
+ "@mongosh/types": "1.9.1",
36
36
  "bson": "^5.2.0",
37
37
  "mocha": "^10.2.0",
38
38
  "postmsg-rpc": "^2.4.0"
@@ -41,5 +41,5 @@
41
41
  "interruptor": "^1.0.1",
42
42
  "system-ca": "^1.0.2"
43
43
  },
44
- "gitHead": "c71dbb701126389e15f54ee9010b0efe32b616b6"
44
+ "gitHead": "c9140a8ad23bd670fb66aff4fc8753306156856b"
45
45
  }
@@ -5,6 +5,7 @@ import { expect } from 'chai';
5
5
  import { WorkerRuntime } from './worker-runtime';
6
6
  import { once } from 'events';
7
7
  import { promisify } from 'util';
8
+ import { dummyOptions } from './index.spec';
8
9
 
9
10
  const childProcessModulePath = path.resolve(
10
11
  __dirname,
@@ -32,7 +33,7 @@ describe('child process worker proxy', () => {
32
33
  it('should start worker runtime and proxy calls', async() => {
33
34
  childProcess = fork(childProcessModulePath);
34
35
  caller = createCaller(['init', 'evaluate'], childProcess);
35
- await caller.init('mongodb://nodb/', {}, { nodb: true });
36
+ await caller.init('mongodb://nodb/', dummyOptions, { nodb: true });
36
37
  const result = await caller.evaluate('1 + 1');
37
38
  expect(result.printable).to.equal(2);
38
39
  });
package/src/index.spec.ts CHANGED
@@ -6,6 +6,13 @@ import { MongoshBus } from '@mongosh/types';
6
6
  import { startTestServer } from '../../../testing/integration-testing-hooks';
7
7
  import { WorkerRuntime } from '../dist/index';
8
8
 
9
+ import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
10
+
11
+ export const dummyOptions: DevtoolsConnectOptions = Object.freeze({
12
+ productName: 'Test Product',
13
+ productDocsLink: 'https://example.com/'
14
+ });
15
+
9
16
  chai.use(sinonChai);
10
17
 
11
18
  function createMockEventEmitter() {
@@ -41,7 +48,7 @@ describe('WorkerRuntime', () => {
41
48
  it('should return init error if child process failed to spawn', async() => {
42
49
  process.env.CHILD_PROCESS_PROXY_SRC_PATH_DO_NOT_USE_THIS_EXCEPT_FOR_TESTING = brokenScript;
43
50
 
44
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
51
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
45
52
 
46
53
  let err;
47
54
 
@@ -56,7 +63,7 @@ describe('WorkerRuntime', () => {
56
63
  });
57
64
 
58
65
  it('should return init error if worker in child process failed to spawn', async() => {
59
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true }, {
66
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true }, {
60
67
  env: {
61
68
  WORKER_RUNTIME_SRC_PATH_DO_NOT_USE_THIS_EXCEPT_FOR_TESTING: brokenScript
62
69
  }
@@ -77,7 +84,7 @@ describe('WorkerRuntime', () => {
77
84
 
78
85
  describe('evaluate', () => {
79
86
  it('should evaluate and return basic values', async() => {
80
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
87
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
81
88
  const result = await runtime.evaluate('1+1');
82
89
 
83
90
  expect(result.printable).to.equal(2);
@@ -85,7 +92,7 @@ describe('WorkerRuntime', () => {
85
92
 
86
93
  describe('errors', () => {
87
94
  it("should throw an error if it's thrown during evaluation", async() => {
88
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
95
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
89
96
 
90
97
  let err: Error;
91
98
 
@@ -104,7 +111,7 @@ describe('WorkerRuntime', () => {
104
111
  });
105
112
 
106
113
  it("should return an error if it's returned from evaluation", async() => {
107
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
114
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
108
115
 
109
116
  const { printable } = await runtime.evaluate(
110
117
  'new SyntaxError("Syntax!")'
@@ -124,7 +131,7 @@ describe('WorkerRuntime', () => {
124
131
  const testServer = startTestServer('shared');
125
132
 
126
133
  it('should return completions', async() => {
127
- runtime = new WorkerRuntime(await testServer.connectionString());
134
+ runtime = new WorkerRuntime(await testServer.connectionString(), dummyOptions);
128
135
  const completions = await runtime.getCompletions('db.coll1.f');
129
136
 
130
137
  expect(completions).to.deep.contain({ completion: 'db.coll1.find' });
@@ -135,7 +142,7 @@ describe('WorkerRuntime', () => {
135
142
  const testServer = startTestServer('shared');
136
143
 
137
144
  it('should return prompt when connected to the server', async() => {
138
- runtime = new WorkerRuntime(await testServer.connectionString());
145
+ runtime = new WorkerRuntime(await testServer.connectionString(), dummyOptions);
139
146
  const result = await runtime.getShellPrompt();
140
147
 
141
148
  expect(result).to.match(/>/);
@@ -148,7 +155,7 @@ describe('WorkerRuntime', () => {
148
155
  onPrompt: sinon.spy(() => 'password123')
149
156
  };
150
157
 
151
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
158
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
152
159
 
153
160
  runtime.setEvaluationListener(evalListener);
154
161
 
@@ -167,7 +174,7 @@ describe('WorkerRuntime', () => {
167
174
 
168
175
  runtime = new WorkerRuntime(
169
176
  await testServer.connectionString(),
170
- {},
177
+ dummyOptions,
171
178
  {},
172
179
  {},
173
180
  eventEmitter
@@ -198,21 +205,21 @@ describe('WorkerRuntime', () => {
198
205
  // strings to make TS happy
199
206
  /* eslint-disable dot-notation */
200
207
  it('should terminate child process', async() => {
201
- const runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
208
+ const runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
202
209
  await runtime.terminate();
203
210
  expect(runtime['childProcess']).to.have.property('killed', true);
204
211
  expect(isRunning(runtime['childProcess'].pid)).to.equal(false);
205
212
  });
206
213
 
207
214
  it('should remove all listeners from childProcess', async() => {
208
- const runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
215
+ const runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
209
216
  await runtime.terminate();
210
217
  expect(runtime['childProcess'].listenerCount('message')).to.equal(0);
211
218
  });
212
219
  /* eslint-enable dot-notation */
213
220
 
214
221
  it('should cancel any in-flight runtime calls', async() => {
215
- const runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
222
+ const runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
216
223
  let err: Error;
217
224
  try {
218
225
  await Promise.all([
@@ -233,7 +240,7 @@ describe('WorkerRuntime', () => {
233
240
 
234
241
  describe('interrupt', () => {
235
242
  it('should interrupt in-flight async tasks', async() => {
236
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
243
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
237
244
 
238
245
  await runtime.waitForRuntimeToBeReady();
239
246
 
@@ -261,7 +268,7 @@ describe('WorkerRuntime', () => {
261
268
  });
262
269
 
263
270
  it('should interrupt in-flight synchronous tasks', async() => {
264
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
271
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
265
272
 
266
273
  await runtime.waitForRuntimeToBeReady();
267
274
 
@@ -286,7 +293,7 @@ describe('WorkerRuntime', () => {
286
293
  });
287
294
 
288
295
  it('should allow to evaluate again after interruption', async() => {
289
- runtime = new WorkerRuntime('mongodb://nodb/', {}, { nodb: true });
296
+ runtime = new WorkerRuntime('mongodb://nodb/', dummyOptions, { nodb: true });
290
297
 
291
298
  await runtime.waitForRuntimeToBeReady();
292
299
 
package/src/index.ts CHANGED
@@ -75,7 +75,7 @@ class WorkerRuntime implements Runtime {
75
75
 
76
76
  constructor(
77
77
  uri: string,
78
- driverOptions: DevtoolsConnectOptions = {},
78
+ driverOptions: DevtoolsConnectOptions,
79
79
  cliOptions: { nodb?: boolean } = {},
80
80
  spawnOptions: SpawnOptionsWithoutStdio = {},
81
81
  eventEmitter: MongoshBus = new EventEmitter()
@@ -10,6 +10,7 @@ import {
10
10
  serializeConnectOptions,
11
11
  deserializeConnectOptions
12
12
  } from './serializer';
13
+ import { dummyOptions } from './index.spec';
13
14
 
14
15
  describe('serializer', () => {
15
16
  describe('serializeError', () => {
@@ -143,6 +144,7 @@ describe('serializer', () => {
143
144
  describe('connection options', () => {
144
145
  it('should serialize and deserialize FLE1 connection options', () => {
145
146
  const options: DevtoolsConnectOptions = {
147
+ ...dummyOptions,
146
148
  autoEncryption: {
147
149
  schemaMap: {
148
150
  'hr.employees': {
@@ -164,6 +166,7 @@ describe('serializer', () => {
164
166
  const serialized = serializeConnectOptions(options);
165
167
 
166
168
  expect(serialized).to.deep.equal({
169
+ ...dummyOptions,
167
170
  autoEncryption: {
168
171
  schemaMap: {
169
172
  'hr.employees': {
@@ -187,6 +190,7 @@ describe('serializer', () => {
187
190
 
188
191
  it('should serialize and deserialize FLE2 connection options', () => {
189
192
  const options: DevtoolsConnectOptions = {
193
+ ...dummyOptions,
190
194
  autoEncryption: {
191
195
  encryptedFieldsMap: {
192
196
  'hr.employees': {
@@ -204,6 +208,7 @@ describe('serializer', () => {
204
208
  const serialized = serializeConnectOptions(options);
205
209
 
206
210
  expect(serialized).to.deep.equal({
211
+ ...dummyOptions,
207
212
  autoEncryption: {
208
213
  encryptedFieldsMap: {
209
214
  'hr.employees': {
package/src/serializer.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { inspect } from 'util';
2
2
  import { EJSON } from 'bson';
3
3
  import { RuntimeEvaluationResult } from '@mongosh/browser-runtime-core';
4
- import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server/lib/cli-service-provider';
4
+ import type { DevtoolsConnectOptions } from '@mongosh/service-provider-server';
5
5
 
6
6
  function isPrimitive(
7
7
  val: any
@@ -117,8 +117,8 @@ const autoEncryptionBSONOptions = [
117
117
  'encryptedFieldsMap'
118
118
  ] as const;
119
119
 
120
- export function serializeConnectOptions(options: Readonly<DevtoolsConnectOptions> = {}): DevtoolsConnectOptions {
121
- const serializedOptions: any = { ...options };
120
+ export function serializeConnectOptions(options: Readonly<DevtoolsConnectOptions>): DevtoolsConnectOptions {
121
+ const serializedOptions = { ...options };
122
122
  for (const autoEncryptionOption of autoEncryptionBSONOptions) {
123
123
  if (serializedOptions.autoEncryption?.[autoEncryptionOption]) {
124
124
  serializedOptions.autoEncryption = {
@@ -11,6 +11,7 @@ import { deserializeEvaluationResult } from './serializer';
11
11
  import type { WorkerRuntime } from './worker-runtime';
12
12
  import { RuntimeEvaluationResult } from '@mongosh/browser-runtime-core';
13
13
  import { interrupt } from 'interruptor';
14
+ import { dummyOptions } from './index.spec';
14
15
 
15
16
  chai.use(sinonChai);
16
17
 
@@ -154,7 +155,7 @@ describe('worker', () => {
154
155
 
155
156
  it(testName, async() => {
156
157
  const { init, evaluate } = caller;
157
- await init('mongodb://nodb/', {}, { nodb: true });
158
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
158
159
  const result = await evaluate(evalValue);
159
160
  expect(result).to.have.property('printable');
160
161
  if (printable instanceof RegExp) {
@@ -350,7 +351,7 @@ describe('worker', () => {
350
351
  }, worker);
351
352
 
352
353
  const { init, evaluate } = caller;
353
- await init(await testServer.connectionString(), {}, {});
354
+ await init(await testServer.connectionString(), dummyOptions, {});
354
355
 
355
356
  if (prepare) {
356
357
  for (const code of prepare) {
@@ -379,7 +380,7 @@ describe('worker', () => {
379
380
  it("should throw an error if it's thrown during evaluation", async() => {
380
381
  const { init, evaluate } = caller;
381
382
 
382
- await init('mongodb://nodb/', {}, { nodb: true });
383
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
383
384
 
384
385
  let err: Error;
385
386
  try {
@@ -399,7 +400,7 @@ describe('worker', () => {
399
400
  it('should preserve extra error properties', async() => {
400
401
  const { init, evaluate } = caller;
401
402
 
402
- await init('mongodb://nodb/', {}, { nodb: true });
403
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
403
404
 
404
405
  let err: Error;
405
406
  try {
@@ -417,7 +418,7 @@ describe('worker', () => {
417
418
  it("should return an error if it's returned from evaluation", async() => {
418
419
  const { init, evaluate } = caller;
419
420
 
420
- await init('mongodb://nodb/', {}, { nodb: true });
421
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
421
422
 
422
423
  const { printable } = await evaluate('new SyntaxError("Syntax!")');
423
424
 
@@ -431,7 +432,7 @@ describe('worker', () => {
431
432
 
432
433
  it('should throw when trying to run two evaluations concurrently', async() => {
433
434
  const { init, evaluate } = caller;
434
- await init('mongodb://nodb/', {}, { nodb: true });
435
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
435
436
 
436
437
  let err: Error;
437
438
 
@@ -531,7 +532,7 @@ describe('worker', () => {
531
532
 
532
533
  exposed = exposeAll(evalListener, worker);
533
534
 
534
- await init('mongodb://nodb/', {}, { nodb: true });
535
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
535
536
  await evaluate('print("Hi!")');
536
537
 
537
538
  expect(evalListener.onPrint).to.have.been.calledWith([
@@ -545,7 +546,7 @@ describe('worker', () => {
545
546
 
546
547
  exposed = exposeAll(evalListener, worker);
547
548
 
548
- await init('mongodb://nodb/', {}, { nodb: true });
549
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
549
550
  await evaluate('print(new ObjectId("62a209b0c7dc31e23ab9da45"))');
550
551
 
551
552
  expect(evalListener.onPrint).to.have.been.calledWith([
@@ -561,7 +562,7 @@ describe('worker', () => {
561
562
 
562
563
  exposed = exposeAll(evalListener, worker);
563
564
 
564
- await init('mongodb://nodb/', {}, { nodb: true });
565
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
565
566
  const password = await evaluate('passwordPrompt()');
566
567
 
567
568
  expect(evalListener.onPrompt).to.have.been.called;
@@ -576,7 +577,7 @@ describe('worker', () => {
576
577
 
577
578
  exposed = exposeAll(evalListener, worker);
578
579
 
579
- await init('mongodb://nodb/', {}, { nodb: true });
580
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
580
581
 
581
582
  await evaluate('config.get("key")');
582
583
  expect(evalListener.getConfig).to.have.been.calledWith('key');
@@ -590,7 +591,7 @@ describe('worker', () => {
590
591
 
591
592
  exposed = exposeAll(evalListener, worker);
592
593
 
593
- await init('mongodb://nodb/', {}, { nodb: true });
594
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
594
595
 
595
596
  await evaluate('config.set("displayBatchSize", 200)');
596
597
  expect(evalListener.validateConfig).to.have.been.calledWith('displayBatchSize', 200);
@@ -605,7 +606,7 @@ describe('worker', () => {
605
606
 
606
607
  exposed = exposeAll(evalListener, worker);
607
608
 
608
- await init('mongodb://nodb/', {}, { nodb: true });
609
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
609
610
 
610
611
  await evaluate('config.reset("displayBatchSize")');
611
612
  expect(evalListener.resetConfig).to.have.been.calledWith('displayBatchSize');
@@ -619,7 +620,7 @@ describe('worker', () => {
619
620
 
620
621
  exposed = exposeAll(evalListener, worker);
621
622
 
622
- await init('mongodb://nodb/', {}, { nodb: true });
623
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
623
624
 
624
625
  await evaluate(`
625
626
  var JSSymbol = Object.getOwnPropertySymbols(Array.prototype)[0].constructor;
@@ -635,7 +636,7 @@ describe('worker', () => {
635
636
 
636
637
  exposed = exposeAll(evalListener, worker);
637
638
 
638
- await init('mongodb://nodb/', {}, { nodb: true });
639
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
639
640
  await evaluate('1+1');
640
641
 
641
642
  const [
@@ -653,7 +654,7 @@ describe('worker', () => {
653
654
 
654
655
  exposed = exposeAll(evalListener, worker);
655
656
 
656
- await init('mongodb://nodb/', {}, { nodb: true });
657
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
657
658
 
658
659
  let err: Error;
659
660
 
@@ -683,7 +684,7 @@ describe('worker', () => {
683
684
  it('should interrupt in-flight async tasks', async() => {
684
685
  const { init, evaluate, interrupt } = caller;
685
686
 
686
- await init('mongodb://nodb/', {}, { nodb: true });
687
+ await init('mongodb://nodb/', dummyOptions, { nodb: true });
687
688
 
688
689
  let err: Error;
689
690