Skip to content

Commit f3bef63

Browse files
committed
fix tests by using elm-test-rs
the node test runner does not like the hacks we do in ./tests/run-tests.sh. However elm-test-rs does not mind, it seems easier to switch test runner than to update the hacks for the node test runner. As an added extra we migrate CI from travis to github actions.
1 parent 8e99db3 commit f3bef63

File tree

5 files changed

+53
-13
lines changed

5 files changed

+53
-13
lines changed

.github/workflows/ci.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
9+
jobs:
10+
main:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
node-version: [14.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: actions/setup-node@v1
22+
with:
23+
node-version: "${{ matrix.node-version }}"
24+
25+
- name: Cache node_modules
26+
id: cache-node_modules
27+
uses: actions/cache@v2
28+
with:
29+
path: node_modules
30+
key: node_modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
31+
32+
- name: Cache ELM_HOME
33+
uses: actions/cache@v2
34+
with:
35+
path: '${{ env.ELM_HOME }}'
36+
key: elm-${{ matrix.os }}-${{ hashFiles('elm-tooling.json', 'elm/**/elm.json', 'example-*/**/elm.json', 'tests/**/elm.json') }}
37+
38+
- name: Install elm-tooling CLI
39+
if: steps.cache-node_modules.outputs.cache-hit != 'true'
40+
run: npm install --no-save elm-tooling
41+
42+
- name: elm-tooling install
43+
run: npx --no-install elm-tooling install
44+
45+
- name: test
46+
run: npx -c ./tests/run-tests.sh

.travis.yml

-11
This file was deleted.

elm-tooling.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tools": {
3+
"elm": "0.19.1",
4+
"elm-test-rs": "1.0.0"
5+
}
6+
}

tests/run-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o nounset;
55

66
#let the caller supply an ELM_TEST binary if desired
77
if [ -z "${ELM_TEST:-}" ]; then
8-
ELM_TEST=elm-test;
8+
ELM_TEST=elm-test-rs
99
fi
1010

1111
# since elm/core is treated specially by the compiler (it's always

tests/tests/Main.elm

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Task exposing (..)
55
import Test exposing (..)
66
import Platform.Cmd exposing (Cmd)
77
import Json.Decode exposing (Value)
8-
import Test.Runner.Node exposing (run, TestProgram)
98
import Test.Array as Array
109
import Test.Basics as Basics
1110
import Test.Bitwise as Bitwise

0 commit comments

Comments
 (0)