summaryrefslogtreecommitdiff
path: root/packages/db/test/error-handling.test.js
diff options
context:
space:
mode:
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',
- });
+ })
});
});
});