Skip to content

Commit 9a969f1

Browse files
committed
chore: switch from oletus to node:test
1 parent 3c6954c commit 9a969f1

File tree

7 files changed

+15
-26
lines changed

7 files changed

+15
-26
lines changed

package-lock.json

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"@biomejs/biome": "1.9.4",
7070
"@types/node": "20.0.0",
7171
"esbuild": "0.24.0",
72-
"oletus": "4.0.0",
7372
"typescript": "5.6.3",
7473
"validate-commit-message": "3.2.0"
7574
},

scripts/test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
. scripts/build.sh
44

55
# unit tests
6-
oletus dist/*/*.test.js tests-corpus/*.test.js tests-corpus/*/*/*.test.js
6+
for test_file in dist/*/*.test.js tests-corpus/*.test.js tests-corpus/*/*/*.test.js; do
7+
node "$test_file"
8+
done
79

810
# lint
911
biome ci --error-on-warnings .

src/parser/bare-lexer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! Licensed under the MIT License (https://mit-license.org/)
33

44
import * as assert from "node:assert/strict"
5-
import { default as test } from "oletus"
5+
import test from "node:test"
66
import * as lex from "./bare-lexer.js"
77

88
const SAMPLE = `

tests-corpus/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import * as assert from "node:assert/strict"
55
import fs from "node:fs"
66
import { relative, resolve } from "node:path"
7+
import { test } from "node:test"
78
import {
89
CompilerError,
910
Config,
1011
configure,
1112
parse,
1213
transform,
1314
} from "@bare-ts/tools"
14-
import { default as test } from "oletus"
1515

1616
const CORPUS_DIR = "./tests-corpus"
1717
const INVALID_BARE_DIR = `${CORPUS_DIR}/invalid-bare-schema`

tests-corpus/valid-bare-schema/x-bareorg-example/user.test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
//! Copyright (c) 2022 Victorien Elvinger
22
//! Licensed under the MIT License (https://mit-license.org/)
33

4-
import { default as test } from "oletus"
4+
import * as assert from "node:assert/strict"
5+
import { test } from "node:test"
56

67
import { Department, decodePerson, encodePerson } from "./out.gen.js"
78

8-
test("x-readme-example", (t) => {
9+
test("x-readme-example", () => {
910
const payload1 = encodePerson({
1011
tag: "Customer",
1112
val: {
@@ -41,7 +42,7 @@ test("x-readme-example", (t) => {
4142
const msg2 = decodePerson(payload2)
4243
const msg3 = decodePerson(payload3)
4344

44-
t.deepEqual(msg1, {
45+
assert.deepEqual(msg1, {
4546
tag: "Customer",
4647
val: {
4748
name: "James Smith",
@@ -57,7 +58,7 @@ test("x-readme-example", (t) => {
5758
},
5859
})
5960

60-
t.deepEqual(msg2, {
61+
assert.deepEqual(msg2, {
6162
tag: "Employee",
6263
val: {
6364
name: "Tiffany Doe",
@@ -70,7 +71,7 @@ test("x-readme-example", (t) => {
7071
},
7172
})
7273

73-
t.deepEqual(msg3, {
74+
assert.deepEqual(msg3, {
7475
tag: "TerminatedEmployee",
7576
val: null,
7677
})

tests-corpus/valid-bare-schema/x-readme-example/user.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
//! Copyright (c) 2022 Victorien Elvinger
22
//! Licensed under the MIT License (https://mit-license.org/)
33

4-
import { default as test } from "oletus"
4+
import * as assert from "node:assert/strict"
5+
import { test } from "node:test"
56

67
import { Gender, decodeContacts, encodeContacts } from "./out.gen.js"
78

8-
test("x-readme-example", (t) => {
9+
test("x-readme-example", () => {
910
const payload = encodeContacts([
1011
{
1112
tag: "Person",
@@ -25,7 +26,7 @@ test("x-readme-example", (t) => {
2526
])
2627
const msg = decodeContacts(payload)
2728

28-
t.deepEqual(msg, [
29+
assert.deepEqual(msg, [
2930
{
3031
tag: "Person",
3132
val: {

0 commit comments

Comments
 (0)