summaryrefslogtreecommitdiff
path: root/packages/db/test/error-handling.test.js
diff options
context:
space:
mode:
authorGravatar Emanuele Stoppa <my.burning@gmail.com> 2024-05-22 09:16:49 +0100
committerGravatar GitHub <noreply@github.com> 2024-05-22 09:16:49 +0100
commit05ef10cdc38878746c91e9032ccb57002ad66963 (patch)
treea12d925e7b54d6535dc5c1c2097fcefb3dd08aae /packages/db/test/error-handling.test.js
parent9ddd6387a7e70d1111dd4a60450d3c710325380c (diff)
downloadastro-05ef10cdc38878746c91e9032ccb57002ad66963.tar.gz
astro-05ef10cdc38878746c91e9032ccb57002ad66963.tar.zst
astro-05ef10cdc38878746c91e9032ccb57002ad66963.zip
chore(db): move tests to node runner (#11109)
Diffstat (limited to 'packages/db/test/error-handling.test.js')
-rw-r--r--packages/db/test/error-handling.test.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/db/test/error-handling.test.js b/packages/db/test/error-handling.test.js
index 9d40507b2..01b701346 100644
--- a/packages/db/test/error-handling.test.js
+++ b/packages/db/test/error-handling.test.js
@@ -1,6 +1,7 @@
-import { expect } from 'chai';
+import { describe, it, before, after } from "node:test";
import { loadFixture } from '../../astro/test/test-utils.js';
import { setupRemoteDbServer } from './test-utils.js';
+import assert from "node:assert/strict"
const foreignKeyConstraintError =
'LibsqlError: SQLITE_CONSTRAINT_FOREIGNKEY: FOREIGN KEY constraint failed';
@@ -26,10 +27,10 @@ describe('astro:db - error handling', () => {
it('Raises foreign key constraint LibsqlError', async () => {
const json = await fixture.fetch('/foreign-key-constraint.json').then((res) => res.json());
- expect(json).to.deep.equal({
+ assert.deepEqual(json, {
message: foreignKeyConstraintError,
code: 'SQLITE_CONSTRAINT_FOREIGNKEY',
- });
+ })
});
});
@@ -47,10 +48,10 @@ describe('astro:db - error handling', () => {
it('Raises foreign key constraint LibsqlError', async () => {
const json = await fixture.readFile('/foreign-key-constraint.json');
- expect(JSON.parse(json)).to.deep.equal({
+ assert.deepEqual(JSON.parse(json), {
message: foreignKeyConstraintError,
code: 'SQLITE_CONSTRAINT_FOREIGNKEY',
- });
+ })
});
});
});