Skip to content

Commit

Permalink
chore: switch from oletus to node:test
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos committed Oct 21, 2024
1 parent 9f6541a commit dbe9b57
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 26 deletions.
14 changes: 0 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@biomejs/biome": "1.9.4",
"@types/node": "20.0.0",
"esbuild": "0.24.0",
"oletus": "4.0.0",
"typescript": "5.6.3",
"validate-commit-message": "3.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
. scripts/build.sh

# unit tests
oletus dist/*/*.test.js tests-corpus/*.test.js tests-corpus/*/*/*.test.js
node --test dist tests-corpus/*.test.js tests-corpus/*/*/*.test.js

# lint
biome ci --error-on-warnings .
Expand Down
2 changes: 1 addition & 1 deletion src/parser/bare-lexer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! Licensed under the MIT License (https://mit-license.org/)

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

const SAMPLE = `
Expand Down
2 changes: 1 addition & 1 deletion tests-corpus/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import * as assert from "node:assert/strict"
import fs from "node:fs"
import { relative, resolve } from "node:path"
import { test } from "node:test"
import {
CompilerError,
Config,
configure,
parse,
transform,
} from "@bare-ts/tools"
import { default as test } from "oletus"

const CORPUS_DIR = "./tests-corpus"
const INVALID_BARE_DIR = `${CORPUS_DIR}/invalid-bare-schema`
Expand Down
11 changes: 6 additions & 5 deletions tests-corpus/valid-bare-schema/x-bareorg-example/user.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//! Copyright (c) 2022 Victorien Elvinger
//! Licensed under the MIT License (https://mit-license.org/)

import { default as test } from "oletus"
import * as assert from "node:assert/strict"
import { test } from "node:test"

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

test("x-readme-example", (t) => {
test("x-readme-example", () => {
const payload1 = encodePerson({
tag: "Customer",
val: {
Expand Down Expand Up @@ -41,7 +42,7 @@ test("x-readme-example", (t) => {
const msg2 = decodePerson(payload2)
const msg3 = decodePerson(payload3)

t.deepEqual(msg1, {
assert.deepEqual(msg1, {
tag: "Customer",
val: {
name: "James Smith",
Expand All @@ -57,7 +58,7 @@ test("x-readme-example", (t) => {
},
})

t.deepEqual(msg2, {
assert.deepEqual(msg2, {
tag: "Employee",
val: {
name: "Tiffany Doe",
Expand All @@ -70,7 +71,7 @@ test("x-readme-example", (t) => {
},
})

t.deepEqual(msg3, {
assert.deepEqual(msg3, {
tag: "TerminatedEmployee",
val: null,
})
Expand Down
7 changes: 4 additions & 3 deletions tests-corpus/valid-bare-schema/x-readme-example/user.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//! Copyright (c) 2022 Victorien Elvinger
//! Licensed under the MIT License (https://mit-license.org/)

import { default as test } from "oletus"
import * as assert from "node:assert/strict"
import { test } from "node:test"

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

test("x-readme-example", (t) => {
test("x-readme-example", () => {
const payload = encodeContacts([
{
tag: "Person",
Expand All @@ -25,7 +26,7 @@ test("x-readme-example", (t) => {
])
const msg = decodeContacts(payload)

t.deepEqual(msg, [
assert.deepEqual(msg, [
{
tag: "Person",
val: {
Expand Down

0 comments on commit dbe9b57

Please sign in to comment.