flake-monster 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flake-monster",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Source-to-source test hardener that injects async delays to surface flaky tests",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,18 +43,23 @@ export function createJavaScriptAdapter() {
43
43
  },
44
44
 
45
45
  inject(source, options) {
46
- const { ast } = parseSource(source);
47
- const { insertions, points } = computeInjections(ast, source, options);
48
- const runtimeNeeded = points.length > 0;
46
+ try {
47
+ const { ast } = parseSource(source);
48
+ const { insertions, points } = computeInjections(ast, source, options);
49
+ const runtimeNeeded = points.length > 0;
49
50
 
50
- if (runtimeNeeded) {
51
- const importPath = computeRuntimeImportPath(options.filePath);
52
- const imp = computeRuntimeImportInsertion(ast, source, importPath);
53
- if (imp) insertions.push(imp);
54
- }
51
+ if (runtimeNeeded) {
52
+ const importPath = computeRuntimeImportPath(options.filePath);
53
+ const imp = computeRuntimeImportInsertion(ast, source, importPath);
54
+ if (imp) insertions.push(imp);
55
+ }
55
56
 
56
- const output = applyInsertions(source, insertions);
57
- return { source: output, points, runtimeNeeded };
57
+ const output = applyInsertions(source, insertions);
58
+ return { source: output, points, runtimeNeeded };
59
+ } catch (err) {
60
+ console.warn(` Skipping ${options.filePath}: ${err.message}`);
61
+ return { source, points: [], runtimeNeeded: false };
62
+ }
58
63
  },
59
64
 
60
65
  remove(source) {
package/src/cli/index.js CHANGED
@@ -9,7 +9,7 @@ export function createCli() {
9
9
  program
10
10
  .name('flake-monster')
11
11
  .description('Source-to-source test hardener, injects async delays to surface flaky tests')
12
- .version('0.1.0');
12
+ .version('0.3.1');
13
13
 
14
14
  registerInjectCommand(program);
15
15
  registerRestoreCommand(program);