Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix windows?
  • Loading branch information
rickhanlonii committed May 15, 2018
commit eefa4e871eb2447a4efbeb95e3ea8c11542540b8
Original file line number Diff line number Diff line change
@@ -1,44 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`creates a snapshot summary 1`] = `
Array [
"<bold>Snapshot Summary</>",
"<bold><green> › 1 snapshot written </></>from 1 test suite.",
"<bold><red> › 1 snapshot failed</></> from 1 test suite. <dim>Inspect your code changes or press --u to update them.</>",
"<bold><green> › 1 snapshot updated </></>from 1 test suite.",
"<bold><yellow> › 1 snapshot file obsolete </></>from 1 test suite. <dim>To remove it, press --u.</>",
"<bold><yellow> › 1 snapshot obsolete </></>from 1 test suite. <dim>To remove it, press --u.</>",
" ↳ <dim>../path/to/</><bold>suite_one</>",
" • unchecked snapshot 1",
]
"<bold>Snapshot Summary</>
<bold><green> › 1 snapshot written </></>from 1 test suite.
<bold><red> › 1 snapshot failed</></> from 1 test suite. <dim>Inspect your code changes or press --u to update them.</>
<bold><green> › 1 snapshot updated </></>from 1 test suite.
<bold><yellow> › 1 snapshot file obsolete </></>from 1 test suite. <dim>To remove it, press --u.</>
<bold><yellow> › 1 snapshot obsolete </></>from 1 test suite. <dim>To remove it, press --u.</>
↳ <dim>../path/to/</><bold>suite_one</>
• unchecked snapshot 1"
`;

exports[`creates a snapshot summary after an update 1`] = `
Array [
"<bold>Snapshot Summary</>",
"<bold><green> › 1 snapshot written </></>from 1 test suite.",
"<bold><red> › 1 snapshot failed</></> from 1 test suite. <dim>Inspect your code changes or press --u to update them.</>",
"<bold><green> › 1 snapshot updated </></>from 1 test suite.",
"<bold><green> › 1 snapshot file removed </></>from 1 test suite.",
"<bold><green> › 1 snapshot removed </></>from 1 test suite.",
" ↳ <dim>../path/to/</><bold>suite_one</>",
" • unchecked snapshot 1",
]
"<bold>Snapshot Summary</>
<bold><green> › 1 snapshot written </></>from 1 test suite.
<bold><red> › 1 snapshot failed</></> from 1 test suite. <dim>Inspect your code changes or press --u to update them.</>
<bold><green> › 1 snapshot updated </></>from 1 test suite.
<bold><green> › 1 snapshot file removed </></>from 1 test suite.
<bold><green> › 1 snapshot removed </></>from 1 test suite.
↳ <dim>../path/to/</><bold>suite_one</>
• unchecked snapshot 1"
`;

exports[`creates a snapshot summary with multiple snapshot being written/updated 1`] = `
Array [
"<bold>Snapshot Summary</>",
"<bold><green> › 2 snapshots written </></>from 2 test suites.",
"<bold><red> › 2 snapshots failed</></> from 2 test suites. <dim>Inspect your code changes or press --u to update them.</>",
"<bold><green> › 2 snapshots updated </></>from 2 test suites.",
"<bold><yellow> › 2 snapshot files obsolete </></>from 2 test suites. <dim>To remove them all, press --u.</>",
"<bold><yellow> › 2 snapshots obsolete </></>from 2 test suites. <dim>To remove them all, press --u.</>",
" ↳ <dim>../path/to/</><bold>suite_one</>",
" • unchecked snapshot 1",
" ↳ <dim>../path/to/</><bold>suite_two</>",
" • unchecked snapshot 2",
]
"<bold>Snapshot Summary</>
<bold><green> › 2 snapshots written </></>from 2 test suites.
<bold><red> › 2 snapshots failed</></> from 2 test suites. <dim>Inspect your code changes or press --u to update them.</>
<bold><green> › 2 snapshots updated </></>from 2 test suites.
<bold><yellow> › 2 snapshot files obsolete </></>from 2 test suites. <dim>To remove them all, press --u.</>
<bold><yellow> › 2 snapshots obsolete </></>from 2 test suites. <dim>To remove them all, press --u.</>
↳ <dim>../path/to/</><bold>suite_one</>
• unchecked snapshot 1
↳ <dim>../path/to/</><bold>suite_two</>
• unchecked snapshot 2"
`;

exports[`returns nothing if there are no updates 1`] = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ test('creates a snapshot summary', () => {
};

expect(
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND),
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND)
.join('\n')
.replace(/\\/g, '/'),
).toMatchSnapshot();
});

Expand All @@ -61,7 +63,9 @@ test('creates a snapshot summary after an update', () => {
};

expect(
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND),
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND)
.join('\n')
.replace(/\\/g, '/'),
).toMatchSnapshot();
});

Expand Down Expand Up @@ -89,7 +93,9 @@ it('creates a snapshot summary with multiple snapshot being written/updated', ()
};

expect(
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND),
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND)
.join('\n')
.replace(/\\/g, '/'),
).toMatchSnapshot();
});

Expand All @@ -107,6 +113,6 @@ it('returns nothing if there are no updates', () => {
updated: 0,
};
expect(
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND),
getSnapshotSummary(snapshots, globalConfig, UPDATE_COMMAND).join('\n'),
).toMatchSnapshot();
});
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test('snapshots all have results (no update)', () => {

const testReporter = new SummaryReporter(globalConfig);
testReporter.onRunComplete(new Set(), aggregatedResults);
expect(results.join('')).toMatchSnapshot();
expect(results.join('').replace(/\\/g, '/')).toMatchSnapshot();
});

test('snapshots all have results (after update)', () => {
Expand Down Expand Up @@ -145,7 +145,7 @@ test('snapshots all have results (after update)', () => {

const testReporter = new SummaryReporter(globalConfig);
testReporter.onRunComplete(new Set(), aggregatedResults);
expect(results.join('')).toMatchSnapshot();
expect(results.join('').replace(/\\/g, '/')).toMatchSnapshot();
});

// TODO: add obsolete snapshots and files
Expand Down