Skip to content

Commit

Permalink
Add tests (#59)
Browse files Browse the repository at this point in the history
A GitHub actions workflow file was added that runs the tests for each
pull request, or push to main or tags.
  • Loading branch information
remcohaszing authored Jan 21, 2023
1 parent 462b715 commit 54952dd
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test

on:
pull_request:
push:
branches: [main]
tags: ['*']

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
3 changes: 2 additions & 1 deletion example/basic/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
entry: "./entry",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: '[name][ext]'
},
module: {
rules: [
Expand Down
3 changes: 2 additions & 1 deletion example/external-config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
entry: "./entry",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: "[name][ext]"
},
module: {
rules: [
Expand Down
3 changes: 2 additions & 1 deletion example/svgo-error/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module.exports = {
entry: "./entry",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: "[name][ext]"
},
module: {
rules: [
Expand Down
42 changes: 42 additions & 0 deletions index.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "svgo loader for webpack",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node --test"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 54952dd

Please sign in to comment.