run tests on Node.js 16

This commit is contained in:
Tobias Koppers 2021-04-27 11:43:25 +02:00
parent 0abe3df1c6
commit 3ddadb2031
3 changed files with 19 additions and 19 deletions

View File

@ -21,7 +21,7 @@ jobs:
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: 16.x
- id: yarn-cache-dir-path - id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1 - uses: actions/cache@v1
@ -43,7 +43,7 @@ jobs:
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: 16.x
- id: yarn-cache-dir-path - id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1 - uses: actions/cache@v1
@ -66,7 +66,7 @@ jobs:
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 14.x node-version: 16.x
- id: yarn-cache-dir-path - id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)" run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1 - uses: actions/cache@v1
@ -93,10 +93,10 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10.x, 14.x] node-version: [10.x, 16.x]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
node-version: 15.x node-version: 14.x
- os: ubuntu-latest - os: ubuntu-latest
node-version: 12.x node-version: 12.x
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@ -8,7 +8,7 @@ jobs:
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: "^14.0.0" versionSpec: "^16.0.0"
displayName: "Install Node.js" displayName: "Install Node.js"
- script: | - script: |
curl -o- -L https://yarnpkg.com/install.sh | bash curl -o- -L https://yarnpkg.com/install.sh | bash
@ -111,8 +111,8 @@ jobs:
node_version: ^10.13.0 node_version: ^10.13.0
node-12: node-12:
node_version: ^12.4.0 node_version: ^12.4.0
node-14: node-16:
node_version: ^14.0.0 node_version: ^16.0.0
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
@ -161,8 +161,8 @@ jobs:
node_version: ^12.4.0 node_version: ^12.4.0
node-14: node-14:
node_version: ^14.0.0 node_version: ^14.0.0
node-15: node-16:
node_version: ^15.0.0 node_version: ^16.0.0
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
@ -212,8 +212,8 @@ jobs:
matrix: matrix:
node-12: node-12:
node_version: ^12.4.0 node_version: ^12.4.0
node-14: node-16:
node_version: ^14.0.0 node_version: ^16.0.0
steps: steps:
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:

View File

@ -1,16 +1,16 @@
// the message is inconsistency between some nodejs versions // the message is inconsistency between some nodejs versions
const UNKNOWN_FUNCTION_TABLE = /invalid index into function table|invalid function/; const UNKNOWN_FUNCTION_TABLE = /table index is out of bounds|invalid index into function table|invalid function/;
it("should support tables", function() { it("should support tables", function () {
return import("./wasm-table.wat").then(function(wasm) { return import("./wasm-table.wat").then(function (wasm) {
expect(wasm.callByIndex(0)).toEqual(42); expect(wasm.callByIndex(0)).toEqual(42);
expect(wasm.callByIndex(1)).toEqual(13); expect(wasm.callByIndex(1)).toEqual(13);
expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE);
}); });
}); });
it("should support exported tables", function() { it("should support exported tables", function () {
return import("./wasm-table-export.wat").then(function(wasm) { return import("./wasm-table-export.wat").then(function (wasm) {
expect(wasm.table).toBeInstanceOf(WebAssembly.Table); expect(wasm.table).toBeInstanceOf(WebAssembly.Table);
expect(wasm.table.length).toBe(2); expect(wasm.table.length).toBe(2);
const e0 = wasm.table.get(0); const e0 = wasm.table.get(0);
@ -22,8 +22,8 @@ it("should support exported tables", function() {
}); });
}); });
it("should support imported tables", function() { it("should support imported tables", function () {
return import("./wasm-table-imported.wat").then(function(wasm) { return import("./wasm-table-imported.wat").then(function (wasm) {
expect(wasm.callByIndex(0)).toEqual(42); expect(wasm.callByIndex(0)).toEqual(42);
expect(wasm.callByIndex(1)).toEqual(13); expect(wasm.callByIndex(1)).toEqual(13);
expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE); expect(() => wasm.callByIndex(2)).toThrow(UNKNOWN_FUNCTION_TABLE);