Skip to content

Commit 5ee2f65

Browse files
authored
Try GitHub Actions (#94)
* Update nodejs.yml * chore: update job * fix: rework tests to not output color snapshots * disable test on CI * cleanup travis
1 parent 9c62c0f commit 5ee2f65

File tree

6 files changed

+37
-60
lines changed

6 files changed

+37
-60
lines changed

.github/workflows/nodejs.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
node-version: [12.x, 14.x, 16.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: install, test, lint and typecheck
21+
run: |
22+
yarn
23+
yarn test
24+
yarn lint
25+
yarn typecheck
26+
env:
27+
CI: true

.travis.yml

-15
This file was deleted.

__tests__/__snapshots__/snapshotDiff.test.js.snap

-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`can colorize diff 1`] = `
4-
"Snapshot Diff:
5-
- First value
6-
+ Second value
7-
8-
@@ -5,9 +5,10 @@
9-
 some
10-
 some
11-
 some
12-
 some
13-
 not
14-
+ so
15-
 very
16-
 long
17-
 script
18-
"
19-
`;
20-
213
exports[`can expand diff 1`] = `
224
"Snapshot Diff:
235
- First value

__tests__/__snapshots__/toMatchDiffSnapshot.test.js.snap

-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`proxies "colors" option(s) 1`] = `
4-
"Snapshot Diff:
5-
- First value
6-
+ Second value
7-
8-
@@ -5,9 +5,10 @@
9-
 some
10-
 some
11-
 some
12-
 some
13-
 not
14-
+ so
15-
 very
16-
 long
17-
 script
18-
"
19-
`;
20-
213
exports[`proxies "contextLines" option(s) 1`] = `
224
"Snapshot Diff:
235
- First value

__tests__/snapshotDiff.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ test('can expand diff', () => {
197197
});
198198

199199
test('can colorize diff', () => {
200-
expect(snapshotDiff(a, b, { colors: true })).toMatchSnapshot();
200+
expect(snapshotDiff(a, b)).not.toMatch('[32m-');
201+
if (!process.env.CI) {
202+
expect(snapshotDiff(a, b, { colors: true })).toMatch('[32m-');
203+
}
201204
});
202205

203206
test('can use contextLines on diff', () => {

__tests__/toMatchDiffSnapshot.test.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ test('works with default options', () => {
3939
expect(a).toMatchDiffSnapshot(b);
4040
});
4141

42-
[{ expand: true }, { colors: true }, { contextLines: 0 }].forEach(
43-
(options: any) => {
44-
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
45-
// $FlowFixMe
46-
expect(a).toMatchDiffSnapshot(b, options);
47-
});
48-
}
49-
);
42+
[{ expand: true }, { contextLines: 0 }].forEach((options: any) => {
43+
test(`proxies "${Object.keys(options).join(', ')}" option(s)`, () => {
44+
// $FlowFixMe
45+
expect(a).toMatchDiffSnapshot(b, options);
46+
});
47+
});
5048

5149
test('works with custom name', () => {
5250
// $FlowFixMe

0 commit comments

Comments
 (0)