Skip to content

Commit 8667a55

Browse files
committed
e
1 parent 33c8601 commit 8667a55

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.roo/rules-code/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ I prefer SIMPLE design with fewer elements
66

77
before running a cli command verify the current working directory via `pwd`
88

9-
run the tests after each change using just `npm test`
9+
run the tests after each change using just `./test.sh`

webapp/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"deploy": "gh-pages -d build",
2424
"start": "react-app-rewired start",
2525
"build": "react-app-rewired build",
26-
"test": "node run-tests-quiet.js",
26+
"test": "react-app-rewired test --watchAll=false",
2727
"test:watch": "react-app-rewired test",
2828
"eject": "react-scripts eject"
2929
},
@@ -48,8 +48,7 @@
4848
"jest": {
4949
"reporters": [
5050
"<rootDir>/jest-quiet-reporter.js"
51-
],
52-
"verbose": false
51+
]
5352
},
5453
"devDependencies": {
5554
"execa": "^5.1.1",

webapp/run-tests-quiet.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@ const child = spawn('npx', ['react-app-rewired', 'test', '--watchAll=false', '--
55
shell: true
66
});
77

8+
let testOutput = '';
9+
810
child.stdout.on('data', (data) => {
911
const output = data.toString();
10-
if (!output.includes('Determining test suites to run')) {
11-
process.stdout.write(output);
12+
if (output.includes('✅') || output.includes('❌')) {
13+
testOutput += output;
1214
}
1315
});
1416

1517
child.stderr.on('data', (data) => {
1618
const output = data.toString();
17-
if (!output.includes('Determining test suites to run')) {
18-
process.stderr.write(output);
19+
if (output.includes('✅') || output.includes('❌')) {
20+
testOutput += output;
1921
}
2022
});
2123

2224
child.on('close', (code) => {
25+
if (testOutput) {
26+
process.stdout.write(testOutput);
27+
}
2328
process.exit(code);
2429
});

webapp/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
node run-tests-quiet.js

0 commit comments

Comments
 (0)