Skip to content

Commit 11eac34

Browse files
loiloczosel
authored andcommitted
Skip standalone build & test when running a regular yarn test (#1279)
1 parent fa0c75b commit 11eac34

3 files changed

Lines changed: 88 additions & 7 deletions

File tree

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ module.exports = {
2020
STANDALONE: false
2121
}
2222
},
23-
...(process.env.SKIP_STANDALONE_TESTS === "true"
24-
? []
25-
: [
23+
...(/^true$/i.test(process.env.RUN_STANDALONE_TESTS)
24+
? [
2625
{
2726
displayName: "test-standalone",
2827
setupFiles: ["<rootDir>/tests_config/run_spec.js"],
@@ -33,7 +32,8 @@ module.exports = {
3332
STANDALONE: true
3433
}
3534
}
36-
]),
35+
]
36+
: []),
3737
{
3838
runner: "jest-runner-eslint",
3939
displayName: "lint",

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"devDependencies": {
1919
"@babel/preset-env": "^7.7.5",
2020
"codecov": "3.6.1",
21+
"cross-env": "^6.0.3",
2122
"eslint": "6.8.0",
2223
"eslint-config-prettier": "6.9.0",
2324
"eslint-plugin-import": "2.19.1",
@@ -36,15 +37,15 @@
3637
"rollup-plugin-node-resolve": "^5.2.0",
3738
"rollup-plugin-replace": "^2.1.0",
3839
"rollup-plugin-terser": "^5.1.1",
39-
"strip-ansi": "^6.0.0"
40+
"strip-ansi": "^6.0.0",
41+
"yarpm": "^0.2.1"
4042
},
4143
"peerDependencies": {
4244
"prettier": "^1.15.0"
4345
},
4446
"scripts": {
45-
"pretest": "npm run build-standalone",
4647
"test": "jest",
47-
"prepublishOnly": "npm run build-standalone",
48+
"prepublishOnly": "yarpm run build-standalone && cross-env RUN_STANDALONE_TESTS=true yarpm test",
4849
"prettier": "prettier --plugin=. --parser=php",
4950
"build-standalone": "rollup -c build/rollup.config.js"
5051
},

yarn.lock

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,11 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
15561556
dependencies:
15571557
delayed-stream "~1.0.0"
15581558

1559+
command-exists@^1.2.2:
1560+
version "1.2.8"
1561+
resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291"
1562+
integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==
1563+
15591564
commander@^2.20.0:
15601565
version "2.20.0"
15611566
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
@@ -1630,6 +1635,22 @@ create-jest-runner@^0.5.3:
16301635
jest-worker "^24.0.0"
16311636
throat "^4.1.0"
16321637

1638+
cross-env@^6.0.3:
1639+
version "6.0.3"
1640+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.3.tgz#4256b71e49b3a40637a0ce70768a6ef5c72ae941"
1641+
integrity sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==
1642+
dependencies:
1643+
cross-spawn "^7.0.0"
1644+
1645+
cross-spawn@^5.1.0:
1646+
version "5.1.0"
1647+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
1648+
integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=
1649+
dependencies:
1650+
lru-cache "^4.0.1"
1651+
shebang-command "^1.2.0"
1652+
which "^1.2.9"
1653+
16331654
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
16341655
version "6.0.5"
16351656
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
@@ -1641,6 +1662,15 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
16411662
shebang-command "^1.2.0"
16421663
which "^1.2.9"
16431664

1665+
cross-spawn@^7.0.0:
1666+
version "7.0.1"
1667+
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14"
1668+
integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==
1669+
dependencies:
1670+
path-key "^3.1.0"
1671+
shebang-command "^2.0.0"
1672+
which "^2.0.1"
1673+
16441674
cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0":
16451675
version "0.3.6"
16461676
resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad"
@@ -3466,6 +3496,14 @@ loose-envify@^1.0.0:
34663496
dependencies:
34673497
js-tokens "^3.0.0 || ^4.0.0"
34683498

3499+
lru-cache@^4.0.1:
3500+
version "4.1.5"
3501+
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd"
3502+
integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==
3503+
dependencies:
3504+
pseudomap "^1.0.2"
3505+
yallist "^2.1.2"
3506+
34693507
magic-string@^0.25.2, magic-string@^0.25.3:
34703508
version "0.25.3"
34713509
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9"
@@ -4022,6 +4060,11 @@ path-key@^2.0.0, path-key@^2.0.1:
40224060
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
40234061
integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=
40244062

4063+
path-key@^3.1.0:
4064+
version "3.1.1"
4065+
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
4066+
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
4067+
40254068
path-parse@^1.0.6:
40264069
version "1.0.6"
40274070
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
@@ -4141,6 +4184,11 @@ prompts@^2.0.1:
41414184
kleur "^3.0.2"
41424185
sisteransi "^1.0.0"
41434186

4187+
pseudomap@^1.0.2:
4188+
version "1.0.2"
4189+
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
4190+
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=
4191+
41444192
psl@^1.1.24, psl@^1.1.28:
41454193
version "1.1.31"
41464194
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
@@ -4606,11 +4654,23 @@ shebang-command@^1.2.0:
46064654
dependencies:
46074655
shebang-regex "^1.0.0"
46084656

4657+
shebang-command@^2.0.0:
4658+
version "2.0.0"
4659+
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
4660+
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
4661+
dependencies:
4662+
shebang-regex "^3.0.0"
4663+
46094664
shebang-regex@^1.0.0:
46104665
version "1.0.0"
46114666
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
46124667
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
46134668

4669+
shebang-regex@^3.0.0:
4670+
version "3.0.0"
4671+
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
4672+
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
4673+
46144674
shellwords@^0.1.1:
46154675
version "0.1.1"
46164676
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
@@ -5279,6 +5339,13 @@ which@^1.2.9, which@^1.3.0:
52795339
dependencies:
52805340
isexe "^2.0.0"
52815341

5342+
which@^2.0.1:
5343+
version "2.0.2"
5344+
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
5345+
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
5346+
dependencies:
5347+
isexe "^2.0.0"
5348+
52825349
wide-align@^1.1.0:
52835350
version "1.1.3"
52845351
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
@@ -5343,6 +5410,11 @@ y18n@^4.0.0:
53435410
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
53445411
integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
53455412

5413+
yallist@^2.1.2:
5414+
version "2.1.2"
5415+
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
5416+
integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=
5417+
53465418
yallist@^3.0.0, yallist@^3.0.2:
53475419
version "3.0.3"
53485420
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
@@ -5371,3 +5443,11 @@ yargs@^13.3.0:
53715443
which-module "^2.0.0"
53725444
y18n "^4.0.0"
53735445
yargs-parser "^13.1.1"
5446+
5447+
yarpm@^0.2.1:
5448+
version "0.2.1"
5449+
resolved "https://registry.yarnpkg.com/yarpm/-/yarpm-0.2.1.tgz#5ff9bab743cdd3e77adfe1f6d6cf3396fa481e64"
5450+
integrity sha1-X/m6t0PN0+d63+H21s8zlvpIHmQ=
5451+
dependencies:
5452+
command-exists "^1.2.2"
5453+
cross-spawn "^5.1.0"

0 commit comments

Comments
 (0)