Adds test workflow

This commit is contained in:
Alexis Rondeau 2020-12-07 11:00:20 +01:00
parent 50454d8e3b
commit 77ff09cd86
2 changed files with 29 additions and 3 deletions

25
.github/workflows/node.js.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Node.js CI
on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

View file

@ -5,9 +5,10 @@
"main": "ExtractHighlightsPlugin.js",
"type": "module",
"scripts": {
"dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js",
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha -r ts-node/register -r ignore-styles -r jsdom-global/register --watch --watch-files src, test/**/*.ts"
"dev": "rollup --config rollup.config.js -w",
"build": "rollup --config rollup.config.js",
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha -r ts-node/register -r ignore-styles -r jsdom-global/register test/**/*.ts",
"test:watch": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha -r ts-node/register -r ignore-styles -r jsdom-global/register --watch --watch-files src, test/**/*.ts"
},
"keywords": [],
"author": "",