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

chore(test): moving unit tests over to vitest #73

Merged
merged 1 commit into from
Sep 1, 2023
Merged
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
10 changes: 1 addition & 9 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,5 @@
"@readme/eslint-config",
"@readme/eslint-config/typescript"
],
"root": true,
"overrides": [
{
"files": ["test/**"],
"rules": {
"func-names": "off"
}
}
]
"root": true
}
8 changes: 0 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,3 @@ updates:
commit-message:
prefix: chore(deps)
prefix-development: chore(deps-dev)
ignore:
# These can't be upgraded because `@jsdevtools/karma-config@3` still requires Webpack 4.
- dependency-name: ts-loader
versions:
- "> 8"
- dependency-name: webpack
versions:
- "> 4"
124 changes: 60 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3.3.1
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
Expand All @@ -40,10 +40,8 @@ jobs:
- ubuntu-latest
- windows-latest
node:
- 14
- 16
- 18
- 19
- 20

steps:
Expand All @@ -60,75 +58,73 @@ jobs:
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3.3.1
- uses: actions/cache@v3
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

# Node 14 still ships with npm@6 which doesn't install peerDeps by default.
- name: Install npm@7
if: matrix.node == '14'
run: npm install -g npm@7

- run: npm ci
- run: npm run build
- run: npm run test --ignore-scripts

browser_tests:
name: Browser
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
browser:
- chrome
- firefox
os:
- ubuntu-latest
- windows-latest

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"

- uses: actions/cache@v3.3.1
id: npm-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- run: npm ci
- run: npm run build

# Chrome
- uses: browser-actions/setup-chrome@latest
if: matrix.browser == 'chrome'

- name: Run tests on Chrome
if: matrix.browser == 'chrome'
run: |
npm run test:browser -- --browsers=ChromeHeadless

# Firefox
- uses: browser-actions/setup-chrome@latest
if: matrix.browser == 'firefox'

- name: Run tests on Firefox
if: matrix.browser == 'firefox'
run: |
npm run test:browser -- --browsers=FirefoxHeadless
###
### Temporarily skipping these until browser testing in Vitest is a bit more stable.
###
# browser_tests:
# name: Browser
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: true
# matrix:
# browser:
# - chrome
# - firefox
# os:
# - ubuntu-latest
# - windows-latest

# steps:
# - name: Checkout source
# uses: actions/checkout@v3

# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 16

# - name: Get npm cache directory
# id: npm-cache-dir
# run: |
# echo "::set-output name=dir::$(npm config get cache)"

# - uses: actions/cache@v3
# id: npm-cache
# with:
# path: ${{ steps.npm-cache-dir.outputs.dir }}
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

# - run: npm ci
# - run: npm run build

# # Chrome
# - uses: browser-actions/setup-chrome@latest
# if: matrix.browser == 'chrome'

# - name: Run tests on Chrome
# if: matrix.browser == 'chrome'
# run: |
# npm run test:browser -- --browsers=ChromeHeadless

# # Firefox
# - uses: browser-actions/setup-chrome@latest
# if: matrix.browser == 'firefox'

# - name: Run tests on Firefox
# if: matrix.browser == 'firefox'
# run: |
# npm run test:browser -- --browsers=FirefoxHeadless
13 changes: 0 additions & 13 deletions .mocharc.json

This file was deleted.

4 changes: 0 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.github/
.nyc_output/
coverage/
test/
.eslint*
.mocha*
.nyc*
.prettier*
karma.*
32 changes: 0 additions & 32 deletions karma.conf.js

This file was deleted.

Loading
Loading