@samitouri / QOS-React-2 / commits / 50d27c325a

Allow tests to be skipped with @skip

Also remove old filename based test directive, since the comment based one is much easier to use

Lauren Tan committed Jan 18, 2023 at 10:58 UTC 50d27c325a3f42fdbec3defc1c76f1e3f92bd23a
1 file changed +4 -14
compiler/forget/src/__tests__/test-utils/generateTestsFromFixtures.ts
+4 -14
@@ -72,20 +72,7 @@ export default function generateTestsFromFixtures(
72 input: inputFile,
73 output: outputFile,
74 } of Array.from(fixtures.values())) {
75 - let testCommand;
76 -
77 - switch (basename.split(".")[0]) {
78 - case "only":
79 - testCommand = test.only;
80 - break;
81 - case "skip":
82 - testCommand = test.skip;
83 - break;
84 - default:
85 - testCommand = test;
86 - break;
87 - }
88 -
75 + let testCommand = test;
76 let input: string | null = null;
77 let debug = false;
78 if (inputFile != null) {
@@ -95,6 +82,9 @@ export default function generateTestsFromFixtures(
82 testCommand = test.only;
83 debug = true;
84 }
85 + if (lines[0]!.indexOf("@skip") !== -1) {
86 + testCommand = test.skip;
87 + }
88 }
89
90 testCommand(basename, () => {