Skip to content

Commit 903e46c

Browse files
committed
Update things
1 parent be66048 commit 903e46c

5 files changed

Lines changed: 605 additions & 2551 deletions

File tree

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,17 @@
1414
"scripts": {
1515
"clean": "rm -rf dist && rm -rf test/dist",
1616
"build": "yarn clean && yarn build:esm && yarn build:cjs && ./module-fixup.sh",
17-
"test": "AWS_SDK_LOAD_CONFIG=1 jest",
17+
"test": "AWS_SDK_LOAD_CONFIG=1 vitest",
1818
"build:esm": "tsc -p tsconfig-esm.json",
1919
"build:cjs": "tsc -p tsconfig-cjs.json"
2020
},
2121
"devDependencies": {
2222
"@tsconfig/node14": "^1.0.1",
23-
"@types/jest": "^27.0.2",
2423
"@types/node": "^16.11.0",
2524
"aws-sdk": "^2.1008.0",
26-
"esbuild": "^0.13.6",
27-
"esbuild-runner": "^2.2.1",
28-
"jest": "^27.2.5",
2925
"kysely": "^0.19.3",
30-
"perf_hooks": "^0.0.1"
26+
"perf_hooks": "^0.0.1",
27+
"vitest": "^0.18.1"
3128
},
3229
"peerDependencies": {
3330
"aws-sdk": "^2.1008.0",

test/harness.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const opts: DataApiDriverConfig = {
1414
};
1515
const dialect = new DataApiDialect({
1616
driver: opts,
17+
mode: "postgres",
1718
});
1819

1920
export interface Person {

test/temporary.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { migrate, db, reset } from "./harness";
2-
3-
jest.setTimeout(1000 * 60);
2+
import { beforeAll, it, beforeEach, expect } from "vitest";
43

54
beforeAll(async () => {
65
await migrate();
@@ -17,15 +16,15 @@ const PERSON = {
1716
} as const;
1817

1918
const PERSON_ALIAS = {
20-
first: "jeff",
21-
last: "bezos"
22-
}
19+
first: "jeff",
20+
last: "bezos",
21+
};
2322

2423
it("insert and read", async () => {
2524
await db
2625
.insertInto("person")
2726
.values({
28-
id: db.generated,
27+
id: generated,
2928
...PERSON,
3029
})
3130
.execute();
@@ -36,9 +35,12 @@ it("insert and read", async () => {
3635
});
3736

3837
it("alias return", async () => {
39-
const result = await db.selectFrom("person").select(["first_name as first", "last_name as last"]).execute();
40-
expect(result).toHaveLength(1);
41-
expect(result[0]).toMatchObject(PERSON_ALIAS);
38+
const result = await db
39+
.selectFrom("person")
40+
.select(["first_name as first", "last_name as last"])
41+
.execute();
42+
expect(result).toHaveLength(1);
43+
expect(result[0]).toMatchObject(PERSON_ALIAS);
4244
});
4345

4446
it("join", async () => {

vitest.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/// <reference types="vitest" />
2+
3+
import { defineConfig } from "vitest/config";
4+
5+
export default defineConfig({
6+
test: {
7+
testTimeout: 90000
8+
},
9+
resolve: {
10+
alias: {
11+
"@serverless-stack/lambda": "./src"
12+
}
13+
}
14+
});

0 commit comments

Comments
 (0)