@percy/config 1.6.4 → 1.7.0

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/dist/load.js CHANGED
@@ -11,7 +11,7 @@ export const cache = new Map(); // The cosmiconfig explorer used to load config
11
11
 
12
12
  export const explorer = cosmiconfigSync('percy', {
13
13
  cache: false,
14
- searchPlaces: ['package.json', '.percyrc', '.percy.json', '.percy.yaml', '.percy.yml', '.percy.js', 'percy.config.js']
14
+ searchPlaces: ['package.json', '.percyrc', '.percy.json', '.percy.yaml', '.percy.yml', '.percy.js', '.percy.cjs', 'percy.config.js', 'percy.config.cjs']
15
15
  }); // Searches within a provided directory, or loads the provided config path
16
16
 
17
17
  export function search(path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/config",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,7 +34,7 @@
34
34
  "test:types": "tsd"
35
35
  },
36
36
  "dependencies": {
37
- "@percy/logger": "1.6.4",
37
+ "@percy/logger": "1.7.0",
38
38
  "ajv": "^8.6.2",
39
39
  "cosmiconfig": "^7.0.0",
40
40
  "yaml": "^2.0.0"
@@ -42,5 +42,5 @@
42
42
  "devDependencies": {
43
43
  "json-schema-typed": "^7.0.3"
44
44
  },
45
- "gitHead": "651c0fad62f128053723f9b8d565c69496dc51e4"
45
+ "gitHead": "f1418fb1effdaad2d32c65d1a358282ab1f9ec32"
46
46
  }
package/test/helpers.js CHANGED
@@ -28,6 +28,9 @@ const INTERNAL_FILE_REG = new RegExp(
28
28
  '(src|dist|test|package\\.json)(\\1|$)'
29
29
  );
30
30
 
31
+ // Used to mock javascript modules
32
+ const JS_FILE_REG = /\.(c|m)?js$/;
33
+
31
34
  // Mock and spy on fs methods using an in-memory filesystem
32
35
  export async function mockfs({
33
36
  // set `true` to allow mocking files within `node_modules` (may cause dynamic import issues)
@@ -45,7 +48,7 @@ export async function mockfs({
45
48
 
46
49
  // when .js files are created, also mock the module for importing
47
50
  spyOn(vol, 'writeFileSync').and.callFake((...args) => {
48
- if (args[0].endsWith('.js')) mockFileModule(...args);
51
+ if (JS_FILE_REG.test(args[0])) mockFileModule(...args);
49
52
  return vol.writeFileSync.and.originalFn.apply(vol, args);
50
53
  });
51
54