Skip to content

Commit f7aa8a7

Browse files
shoterbokuweb
authored andcommitted
Made setting environment variable in test script compatible with (#566)
multiple environments Previously it only worked probably on linux only-systems. It had command `NODE_ENV='test'` which did not work under Windows. I had used library cross-env in order to make it runnable under windows
1 parent 0b5c547 commit f7aa8a7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build:prod:main": "rollup -c scripts/prod.js",
2222
"build:prod:es5": "rollup -c scripts/prod.es5.js",
2323
"build": "npm-run-all --serial build:prod:* copy:flow",
24-
"test": "NODE_ENV='test' tsc && avaron lib/index.test.js --renderer",
24+
"test": "cross-env NODE_ENV='test' tsc && avaron lib/index.test.js --renderer",
2525
"copy:flow": "cpy src/index.js.flow lib && cpy src/index.js.flow lib --rename index.es5.js.flow",
2626
"test:ci": "npm run flow && npm run build",
2727
"prepublish": "npm run build",
@@ -89,7 +89,8 @@
8989
"tslint-eslint-rules": "5.4.0",
9090
"tslint-plugin-prettier": "2.0.1",
9191
"tslint-react": "4.0.0",
92-
"typescript": "3.5.3"
92+
"typescript": "3.5.3",
93+
"cross-env" : "5.2.0"
9394
},
9495
"files": [
9596
"lib"

yarn.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4162,6 +4162,14 @@ create-react-context@^0.2.1:
41624162
fbjs "^0.8.0"
41634163
gud "^1.0.0"
41644164

4165+
cross-env@5.2.0:
4166+
version "5.2.0"
4167+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
4168+
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
4169+
dependencies:
4170+
cross-spawn "^6.0.5"
4171+
is-windows "^1.0.0"
4172+
41654173
cross-spawn@6.0.5, cross-spawn@^6.0.5:
41664174
version "6.0.5"
41674175
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
@@ -6506,7 +6514,7 @@ is-utf8@^0.2.0, is-utf8@^0.2.1:
65066514
version "0.2.1"
65076515
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
65086516

6509-
is-windows@^1.0.2:
6517+
is-windows@^1.0.0, is-windows@^1.0.2:
65106518
version "1.0.2"
65116519
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
65126520

0 commit comments

Comments
 (0)