Skip to content

Commit

Permalink
test: replace uvu with AVA
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Jul 13, 2023
1 parent 5feb45e commit 11ed65f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:ava/recommended"
],
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "ava"],
"env": {
"node": true
},
Expand Down
7 changes: 7 additions & 0 deletions ava.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
files: ["./test/**/*.test.ts"],
extensions: {
ts: "module",
},
nodeArguments: ["--no-warnings", "--loader=tsx"],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"scripts": {
"compile": "tsc --build",
"lint": "eslint . --ext '.ts'",
"test:unit": "NODE_OPTIONS='--loader tsx --no-warnings' uvu 'test' '.*\\.test\\.ts$'",
"test:unit": "ava",
"test:unit:coverage": "c8 npm run test:unit"
},
"devDependencies": {
Expand Down
9 changes: 3 additions & 6 deletions test/toUint8Array.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { test } from "uvu";
import * as assert from "uvu/assert";
import test from "ava";
import atob from "atob";
import { toUint8Array } from "../src/toUint8Array.js";

test("convert given base64 string to an Uint8Array", () => {
test("convert given base64 string to an Uint8Array", (t) => {
const actual = toUint8Array("BIW2q45TM1wfJz9", atob);

assert.equal(actual.toString(), "4,133,182,171,142,83,51,92,31,39,63");
t.is(actual.toString(), "4,133,182,171,142,83,51,92,31,39,63");
});

test.run();

0 comments on commit 11ed65f

Please sign in to comment.