Skip to content

Commit 4b0050a

Browse files
committed
chore: remove cleaning dependencies from test-runner
It doesn't change much since the e2e projects are packages of the monorepo and most of their dependencies will be stored in node_modules directory at the root level.
1 parent 8eb2cee commit 4b0050a

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

e2e/test-runner.js

+6-24
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ const fs = require('fs')
22
const path = require('path')
33
const { spawn } = require('child_process')
44
const chalk = require('chalk')
5-
const rimraf = require('rimraf')
65

7-
// Can be run as `yarn test:e2e --cache` to forego reinstalling node_modules, or
8-
// `yarn test:e2e 3.x`, or `yarn test:e2e 3.x/<projects dir>`, or
9-
// `yarn test:e2e --cache 3.x/<projects dir>`.
6+
/**
7+
* Can be run as
8+
* - `yarn test:e2e 3.x` to run only the 3.x tests
9+
* - `yarn test:e2e 3.x/<projects dir>` to run only the test of a specific project
10+
*/
1011
const args = process.argv.slice(2)
1112

1213
async function runTests() {
@@ -32,27 +33,12 @@ async function runTests() {
3233
}
3334

3435
async function runTest(dir) {
35-
if (!args.includes('--cache')) {
36-
await remove(dir, 'node_modules')
37-
await remove(dir, 'yarn.lock')
38-
await installDependencies(dir)
39-
}
40-
logStep(dir, 'Running tests')
36+
info(`(${dir}) Running tests`)
4137
await execute(dir, 'yarn test')
4238

4339
success(`(${dir}) Complete`)
4440
}
4541

46-
async function remove(dir, target) {
47-
logStep(dir, `Removing ${target}`)
48-
await new Promise(resolve => rimraf(`${dir}/${target}`, resolve))
49-
}
50-
51-
async function installDependencies(dir) {
52-
logStep(dir, 'Installing node_modules')
53-
await execute(dir, 'yarn install --silent')
54-
}
55-
5642
async function execute(dir, command) {
5743
const exitCode = await new Promise((resolve, reject) => {
5844
const [cmd, ...args] = command.split(' ')
@@ -70,10 +56,6 @@ function filterDirectories(directories) {
7056
return filtered.length ? filtered : directories
7157
}
7258

73-
function logStep(dir, msg) {
74-
return info(`(${dir}) ${msg}`)
75-
}
76-
7759
function success(msg) {
7860
console.info(chalk.green(formatLog(msg)))
7961
}

0 commit comments

Comments
 (0)