Skip to content

Commit

Permalink
add npm test to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Jul 11, 2023
1 parent 5a61eb8 commit 14fc45a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ jobs:
with:
path: |
./target
~/.cargo
~/.cargo
key: debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
debug-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-
debug-${{ runner.os }}-
- name: Run tests
run: cargo test --verbose
run: cargo test --verbose
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: wasm-pack build --target nodejs
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- run: npm ci
- run: npm test
16 changes: 15 additions & 1 deletion test/node-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ describe("something", function() {
expect(function() {
p.process(`const thing = "face";
<template>Hi`);
}).to.throw('error at: anon-file:2:39: 2:39 - Unexpected eof');
}).to.throw(`× Unexpected eof
╭─[:1:1]
1 │ const thing = "face";
2 │ <template>Hi
╰────`);
})

it("shows a graphical error info that points to the problem", function() {
expect(function() {
p.process(`class {`)
}).to.throw(`× Expected ident
╭─[:1:1]
1 │ class {
· ─
╰────`);
});
})

0 comments on commit 14fc45a

Please sign in to comment.