Skip to content

Commit 9ddd047

Browse files
committed
Use cross-spawn to help with Windows issues.
Fixes typegoose#180
1 parent 2860c7d commit 9ddd047

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "In-memory MongoDB Server. Designed with testing in mind, the server will allow you to connect your favourite ODM or client library to the MongoDB Server and run integration tests isolated from each other.",
66
"repository": "https://github.com/nodkz/mongodb-memory-server",
77
"devDependencies": {
8+
"@types/cross-spawn": "^6.0.0",
89
"@types/decompress": "^4.2.3",
910
"@types/dedent": "^0.7.0",
1011
"@types/find-cache-dir": "^2.0.0",

packages/mongodb-memory-server-core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"homepage": "https://github.com/nodkz/mongodb-memory-server",
2626
"dependencies": {
2727
"camelcase": "^5.3.1",
28+
"cross-spawn": "^6.0.5",
2829
"debug": "^4.1.1",
2930
"decompress": "^4.2.0",
3031
"dedent": "^0.7.0",

packages/mongodb-memory-server-core/src/util/MongoInstance.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ChildProcess, spawn as spawnChild } from 'child_process';
1+
import { ChildProcess } from 'child_process';
2+
import { default as spawnChild } from 'cross-spawn';
23
import path from 'path';
34
import MongoBinary from './MongoBinary';
45
import { MongoBinaryOpts } from './MongoBinary';
@@ -62,7 +63,7 @@ export default class MongoInstance {
6263
this.debug = console.log.bind(null);
6364
}
6465
} else {
65-
this.debug = () => {};
66+
this.debug = () => { };
6667
}
6768

6869
// add instance's port to debug output

yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,13 @@
10021002
dependencies:
10031003
"@types/node" "*"
10041004

1005+
"@types/cross-spawn@^6.0.0":
1006+
version "6.0.0"
1007+
resolved "https://registry.yarnpkg.com/@types/cross-spawn/-/cross-spawn-6.0.0.tgz#320aaf1d1a12979f1b84fe7a5590a7e860bf3a80"
1008+
integrity sha512-evp2ZGsFw9YKprDbg8ySgC9NA15g3YgiI8ANkGmKKvvi0P2aDGYLPxQIC5qfeKNUOe3TjABVGuah6omPRpIYhg==
1009+
dependencies:
1010+
"@types/node" "*"
1011+
10051012
"@types/decompress@^4.2.3":
10061013
version "4.2.3"
10071014
resolved "https://registry.yarnpkg.com/@types/decompress/-/decompress-4.2.3.tgz#98eed48af80001038aa05690b2094915f296fe65"

0 commit comments

Comments
 (0)