Skip to content

Commit b36fb9c

Browse files
committedDec 30, 2018
Fixing snapshot filenames when running all tests (Fixes #10)
Fixes #10
1 parent 55fb5c9 commit b36fb9c

40 files changed

+3046
-786
lines changed
 

‎__tests__/plugin.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ describe('plugin', () => {
3232
const { initPlugin } = require('../plugin');
3333

3434
initPlugin(on, globalConfig);
35-
expect(on).toBeCalledTimes(2);
35+
expect(on).toBeCalledTimes(3);
3636
});
3737
});

‎__tests__/utils/commands.test.js ‎__tests__/utils/commands/commands.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const rewire = require('rewire');
22

3-
const DEFAULT_CONFIG = rewire('../../src/config').__get__('DEFAULT_CONFIG');
3+
const DEFAULT_CONFIG = rewire('../../../src/config').__get__('DEFAULT_CONFIG');
44

55
global.Cypress = {
66
env: () => {},
@@ -27,19 +27,19 @@ describe('utils/command', () => {
2727
return returnValue;
2828
};
2929

30-
const getConfig = require('../../src/utils/commands/getConfig');
30+
const getConfig = require('../../../src/utils/commands/getConfig');
3131
expect(getConfig()).toMatchObject(DEFAULT_CONFIG);
3232
});
3333

3434
it('with config', () => {
3535
global.Cypress.env = () => CONFIG;
36-
const getConfig = require('../../src/utils/commands/getConfig');
36+
const getConfig = require('../../../src/utils/commands/getConfig');
3737
expect(getConfig()).toMatchObject(CONFIG);
3838
});
3939

4040
it('without config - error should be thrown', () => {
4141
global.Cypress.env = () => undefined;
42-
const getConfig = require('../../src/utils/commands/getConfig');
42+
const getConfig = require('../../../src/utils/commands/getConfig');
4343
expect(() => { getConfig(); }).toThrow();
4444
});
4545
});

‎__tests__/utils/tasks/applyReplace.test.js ‎__tests__/utils/text/applyReplace.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint no-template-curly-in-string: 0 */
22
describe('utils/tasks/applyReplace', () => {
3-
const applyReplace = require('../../../src/utils/tasks/applyReplace');
3+
const applyReplace = require('../../../src/utils/text/applyReplace');
44

55
it('object replace', () => {
66
const expected = {

‎__tests__/utils/keepKeysFromExpected.test.js ‎__tests__/utils/text/keepKeysFromExpected.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('utils/keepKeysFromExpected', () => {
2525
ignoreExtraFields: false,
2626
ignoreExtraArrayItems: false,
2727
};
28-
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected');
28+
const keepKeysFromExpected = require('../../../src/utils/text/keepKeysFromExpected');
2929
const result = keepKeysFromExpected(actual, expected, config);
3030
expect(result).toMatchSnapshot();
3131
});
@@ -35,7 +35,7 @@ describe('utils/keepKeysFromExpected', () => {
3535
ignoreExtraFields: true,
3636
ignoreExtraArrayItems: false,
3737
};
38-
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected');
38+
const keepKeysFromExpected = require('../../../src/utils/text/keepKeysFromExpected');
3939
const result = keepKeysFromExpected(actual, expected, config);
4040
expect(result).toMatchSnapshot();
4141
});
@@ -45,7 +45,7 @@ describe('utils/keepKeysFromExpected', () => {
4545
ignoreExtraFields: true,
4646
ignoreExtraArrayItems: true,
4747
};
48-
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected');
48+
const keepKeysFromExpected = require('../../../src/utils/text/keepKeysFromExpected');
4949
const result = keepKeysFromExpected(actual, expected, config);
5050
expect(result).toMatchSnapshot();
5151
});
@@ -55,7 +55,7 @@ describe('utils/keepKeysFromExpected', () => {
5555
ignoreExtraFields: false,
5656
ignoreExtraArrayItems: true,
5757
};
58-
const keepKeysFromExpected = require('../../src/utils/keepKeysFromExpected');
58+
const keepKeysFromExpected = require('../../../src/utils/text/keepKeysFromExpected');
5959
const result = keepKeysFromExpected(actual, expected, config);
6060
expect(result).toMatchSnapshot();
6161
});

0 commit comments

Comments
 (0)
Please sign in to comment.