Skip to content

Commit

Permalink
Add c8 code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tolauwae committed Dec 4, 2024
1 parent 50de133 commit 22dd3a0
Show file tree
Hide file tree
Showing 7 changed files with 1,144 additions and 542 deletions.
6 changes: 6 additions & 0 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporter": [
"json",
"text"
]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ lib/*.js
test/*.js
*.map

# Project specific
WABT
core/

dist/

# IDE folders
.idea

# c8 Coverage
coverage
out
1,608 changes: 1,090 additions & 518 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"lint": "eslint src --ext ts",
"test:all": "npx ts-node tests/test.ts && npm run test:ava",
"test:ava": "ava",
"debugtest": "npx ts-node tests/debugger.test.ts",
"spectest": "npx ts-node tests/spec.ts"
"test:coverage": "c8 --src src/ --all ava"
},
"dependencies": {
"ansi-colors": "^4.1.3",
Expand All @@ -32,24 +31,28 @@
"ts-node": "^10.5.0"
},
"devDependencies": {
"@ava/typescript": "^5.0.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.1.0",
"@types/node": "^20.10.4",
"@types/uuid": "^9.0.0",
"@types/ws": "^8.5.4",
"ava": "^6.2.0",
"@ava/typescript": "^5.0.0",
"c8": "^10.1.2",
"convert-extension": "^0.3.0",
"mqtt": "^4.3.7",
"serialport": "^10.4.0",
"typescript": "^4.5.5"
"typescript": "^5.2.0"
},
"ava": {
"files": [
"tests/unit.ts"
"out/tests/unit.js"
],
"extensions": [
"ts"
]
"typescript": {
"compile": "tsc",
"rewritePaths": {
"source/": "dist/"
}
}
}
}
File renamed without changes.
15 changes: 14 additions & 1 deletion tests/unit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const test = require('ava');
import test from 'ava';
import {getFileExtension} from '../src/util/util';

test('[internal] test util/getFileExtension', t => {
t.is(getFileExtension('test.wast'), 'wast');
});

test('[warduino] start emulator', t => {
t.pass();
Expand Down Expand Up @@ -36,3 +41,11 @@ test('[dummy] passing count', t => {
t.pass();
});

test('[dummy] log file create', t => {
t.pass();
});

test('[dummy] log file correct', t => {
t.pass();
});

32 changes: 17 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "ES2020",
"outDir": "out",
"lib": [
"ES2020"
],
"rootDir": ".",
"sourceMap": true,
"strict": true,
"allowSyntheticDefaultImports": true
},
"exclude": [
"WABT"
]
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "ES2020",
"outDir": "out",
"lib": [
"ES2020"
],
"rootDir": ".",
"sourceMap": true,
"strict": true,
"allowSyntheticDefaultImports": true,
},
"exclude": [
"example",
"WABT"
]
}

0 comments on commit 22dd3a0

Please sign in to comment.