Skip to content

Commit 54952dd

Browse files
authored
Add tests (#59)
A GitHub actions workflow file was added that runs the tests for each pull request, or push to main or tags.
1 parent 462b715 commit 54952dd

File tree

6 files changed

+70
-4
lines changed

6 files changed

+70
-4
lines changed

.github/workflows/ci.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
tags: ['*']
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [16, 18]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
21+
- run: npm test

example/basic/webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
entry: "./entry",
55
output: {
66
path: __dirname + "/dist",
7-
filename: "bundle.js"
7+
filename: "bundle.js",
8+
assetModuleFilename: '[name][ext]'
89
},
910
module: {
1011
rules: [

example/external-config/webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
entry: "./entry",
55
output: {
66
path: __dirname + "/dist",
7-
filename: "bundle.js"
7+
filename: "bundle.js",
8+
assetModuleFilename: "[name][ext]"
89
},
910
module: {
1011
rules: [

example/svgo-error/webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module.exports = {
44
entry: "./entry",
55
output: {
66
path: __dirname + "/dist",
7-
filename: "bundle.js"
7+
filename: "bundle.js",
8+
assetModuleFilename: "[name][ext]"
89
},
910
module: {
1011
rules: [

index.test.js

+42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "svgo loader for webpack",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "node --test"
88
},
99
"repository": {
1010
"type": "git",

0 commit comments

Comments
 (0)