Skip to content

Commit

Permalink
test: use vitest instead of ava
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Oct 9, 2022
1 parent ad58ee0 commit 8855b62
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
15 changes: 0 additions & 15 deletions .c8rc.json

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"scripts": {
"compile": "tsc --build",
"lint": "eslint src test --ext '.ts'",
"test:unit": "ava",
"test:unit:coverage": "c8 ava"
"test:unit": "vitest",
"test:unit:coverage": "vitest run --coverage"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.1",
Expand Down
7 changes: 4 additions & 3 deletions test/toUint8Array.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import test from "ava";
import { test, assert } from "vitest";
import atob from "atob";
import { toUint8Array } from "../src/toUint8Array.js";

test("convert given base64 string to an Uint8Array", (t) => {
test("convert given base64 string to an Uint8Array", () => {
const actual = toUint8Array("BIW2q45TM1wfJz9", atob);
t.is(actual.toString(), "4,133,182,171,142,83,51,92,31,39,63");

assert.strictEqual(actual.toString(), "4,133,182,171,142,83,51,92,31,39,63");
});
20 changes: 20 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
coverage: {
all: true,
lines: 100,
functions: 100,
statements: 100,
branches: 100,
extension: [".ts"],
include: ["src/**/*"],
exclude: ["src/index.ts"],
provider: "c8",
reporter: ["lcov", "text-summary", "clover"],
reportsDirectory: "./target/coverage",
},
include: ["./test/**/*.test.ts"],
},
});

0 comments on commit 8855b62

Please sign in to comment.