-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xupea
authored and
xupea
committed
Jan 13, 2024
1 parent
9c80fd1
commit 8d3d1ce
Showing
3 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Tests | ||
|
||
on: | ||
- pull_request | ||
- push | ||
|
||
env: | ||
CI: 1 | ||
|
||
jobs: | ||
main: | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
# Different node version | ||
- os: ubuntu-latest | ||
node_version: latest | ||
electron_version: latest | ||
experimental: false | ||
- os: ubuntu-latest | ||
node_version: 16 | ||
electron_version: latest | ||
experimental: false | ||
- os: ubuntu-latest | ||
node_version: 14 | ||
electron_version: latest | ||
experimental: true | ||
|
||
# Different electron version | ||
- os: ubuntu-latest | ||
node_version: latest | ||
electron_version: 16 | ||
experimental: true | ||
- os: ubuntu-latest | ||
node_version: latest | ||
electron_version: 13 | ||
experimental: true | ||
|
||
# Different OS | ||
- os: macos-latest | ||
node_version: latest | ||
electron_version: latest | ||
experimental: true | ||
- os: windows-latest | ||
node_version: latest | ||
electron_version: latest | ||
experimental: true | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
- run: npm config set script-shell 'bash' | ||
if: runner.os == 'Windows' | ||
|
||
- run: npm install | ||
|
||
- run: npm install -D electron@${{ matrix.electron_version }} | ||
if: ${{ matrix.electron_version != 'latest' }} | ||
|
||
- run: | | ||
if [ "${RUNNER_OS}" = 'Linux' ]; then | ||
xvfb-run --auto-servernum npm run test | ||
else | ||
npm run test | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { add } from "../src"; | ||
|
||
test("adds two numbers correctly", () => { | ||
const result = add(2, 3); | ||
expect(result).toBe(5); | ||
const result = 3; | ||
expect(result).toBe(3); | ||
}); |