Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI config to include recent jest and node versions #267

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 11 additions & 14 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 13.x, 14.x, 16.x]
jest-version: [24, 25, 26, 27]
exclude:
# jest@27 doesn't support node@13
- node-version: 13.x
jest-version: 27
node-version: [18.x, 19.x, 20.x]
jest-version: [29]
runs-on: ubuntu-latest

steps:
Expand All @@ -30,28 +26,29 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: install with jest v${{ matrix.jest-version }}
run: |
yarn add --dev jest@${{ matrix.jest-version }} babel-jest@${{ matrix.jest-version }}
yarn
npm install --dev jest@${{ matrix.jest-version }} babel-jest@${{ matrix.jest-version }}
npm install --no-audit
npm rebuild
- name: run tests
run: yarn test
run: npm run test
test-os:
name: Test on ${{ matrix.os }} using Node.js LTS
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
cache: yarn
- name: install
run: yarn
run: |
npm install --no-audit
npm rebuild
- name: run tests
run: yarn test
run: npm run test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Note: as of jest-junit 11.0.0 NodeJS >= 10.12.0 is required.
```shell
yarn add --dev jest-junit
```

## Usage
In your jest config add the following entry:
```JSON
Expand Down
60 changes: 30 additions & 30 deletions __tests__/__snapshots__/buildJsonResults.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`buildJsonResults should support displayName template var for jest multi-project 1`] = `
Object {
"testsuites": Array [
Object {
"_attr": Object {
{
"testsuites": [
{
"_attr": {
"errors": 0,
"failures": 0,
"name": "jest tests",
"tests": 2,
"time": 1.234,
},
},
Object {
"testsuite": Array [
Object {
"_attr": Object {
{
"testsuite": [
{
"_attr": {
"errors": 0,
"failures": 0,
"name": "project1-foo",
Expand All @@ -25,22 +25,22 @@ Object {
"timestamp": "2018-02-10T14:52:31",
},
},
Object {
"properties": Array [
Object {
"property": Object {
"_attr": Object {
{
"properties": [
{
"property": {
"_attr": {
"name": "best-tester",
"value": "Jason Palmer",
},
},
},
],
},
Object {
"testcase": Array [
Object {
"_attr": Object {
{
"testcase": [
{
"_attr": {
"classname": "a thing should foo",
"name": "project1-bar",
"time": 0.003,
Expand All @@ -50,10 +50,10 @@ Object {
},
],
},
Object {
"testsuite": Array [
Object {
"_attr": Object {
{
"testsuite": [
{
"_attr": {
"errors": 0,
"failures": 0,
"name": "project2-foo",
Expand All @@ -63,22 +63,22 @@ Object {
"timestamp": "2018-02-10T14:52:31",
},
},
Object {
"properties": Array [
Object {
"property": Object {
"_attr": Object {
{
"properties": [
{
"property": {
"_attr": {
"name": "best-tester",
"value": "Jason Palmer",
},
},
},
],
},
Object {
"testcase": Array [
Object {
"_attr": Object {
{
"testcase": [
{
"_attr": {
"classname": "another thing should foo",
"name": "project2-bar",
"time": 0.001,
Expand Down
116 changes: 58 additions & 58 deletions __tests__/buildJsonResults.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,69 +454,69 @@ describe('buildJsonResults', () => {
});

expect(jsonResults).toMatchInlineSnapshot(`
Object {
"testsuites": Array [
Object {
"_attr": Object {
"errors": 0,
"failures": 0,
"name": "jest tests",
"tests": 1,
"time": 1.234,
},
{
"testsuites": [
{
"_attr": {
"errors": 0,
"failures": 0,
"name": "jest tests",
"tests": 1,
"time": 1.234,
},
},
{
"testsuite": [
{
"_attr": {
"errors": 0,
"failures": 0,
"name": "foo",
"skipped": 0,
"tests": 1,
"time": 0.12,
"timestamp": "2017-03-17T01:05:47",
},
Object {
"testsuite": Array [
Object {
"_attr": Object {
"errors": 0,
"failures": 0,
"name": "foo",
"skipped": 0,
"tests": 1,
"time": 0.12,
"timestamp": "2017-03-17T01:05:47",
},
{
"properties": [
{
"property": {
"_attr": {
"name": "best-tester",
"value": "Jason Palmer",
},
},
Object {
"properties": Array [
Object {
"property": Object {
"_attr": Object {
"name": "best-tester",
"value": "Jason Palmer",
},
},
},
],
},
],
},
{
"testcase": [
{
"_attr": {
"classname": "foo baz should bar",
"name": "foo baz should bar",
"time": 0.001,
},
Object {
"testcase": Array [
Object {
"_attr": Object {
"classname": "foo baz should bar",
"name": "foo baz should bar",
"time": 0.001,
},
{
"properties": [
{
"property": {
"_attr": {
"name": "dd_tags[test.invocations]",
"value": 2,
},
},
Object {
"properties": Array [
Object {
"property": Object {
"_attr": Object {
"name": "dd_tags[test.invocations]",
"value": 2,
},
},
},
],
},
],
},
],
},
],
}
`)
},
],
},
],
},
],
},
],
}
`)
});
});
Loading
Loading