as-test 1.0.1 → 1.0.3

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.
@@ -99,9 +99,9 @@ function analyzeSourceText(sourceText) {
99
99
  const runAlias = detectRunAlias(text);
100
100
  const hasRunCall = runAlias
101
101
  ? new RegExp(`\\b${escapeRegex(runAlias)}\\s*\\(`).test(text)
102
- : /\brun\s*\(/.test(text);
102
+ : false;
103
103
  return {
104
- hasSuiteCalls: /\b(?:describe|test|it)\s*\(/.test(text),
104
+ hasSuiteCalls: /\b(?:describe|test|it|only|xonly|todo|fuzz|xfuzz)\s*\(/.test(text),
105
105
  hasRunCall,
106
106
  runImportPath,
107
107
  hasMockCalls: /\b(?:mockFn|unmockFn|mockImport|unmockImport)\s*\(/.test(text),
@@ -135,7 +135,7 @@ function detectRunAlias(text) {
135
135
  return null;
136
136
  }
137
137
  function looksLikeAsTestImport(specifiers) {
138
- return /\b(?:describe|test|it|expect|beforeAll|afterAll|beforeEach|afterEach|mockFn|unmockFn|mockImport|unmockImport|snapshotImport|restoreImport|log|run)\b/.test(specifiers);
138
+ return /\b(?:describe|test|it|only|xonly|todo|fuzz|xfuzz|expect|beforeAll|afterAll|beforeEach|afterEach|mockFn|unmockFn|mockImport|unmockImport|snapshotFn|log|run)\b/.test(specifiers);
139
139
  }
140
140
  function stripComments(sourceText) {
141
141
  return sourceText.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "");
@@ -73,7 +73,7 @@ function detectAsTestImportPath(sourceText) {
73
73
  function looksLikeAsTestImport(specifiers, modulePath) {
74
74
  if (modulePath === "as-test" || modulePath.endsWith("/as-test"))
75
75
  return true;
76
- return /\b(?:describe|test|it|expect|beforeAll|afterAll|beforeEach|afterEach|mockFn|unmockFn|mockImport|unmockImport|snapshotImport|restoreImport|log|run)\b/.test(specifiers);
76
+ return /\b(?:describe|test|it|expect|beforeAll|afterAll|beforeEach|afterEach|mockFn|unmockFn|mockImport|unmockImport|snapshotFn|log|run)\b/.test(specifiers);
77
77
  }
78
78
  function stripComments(sourceText) {
79
79
  return sourceText.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\/\/.*$/gm, "");