@kunk/test 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +12 -0
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +1 -0
- package/package.json +21 -0
- package/src/index.ts +10 -0
- package/src/setup.ts +16 -0
- package/tsconfig.json +18 -0
- package/tsdown.config.ts +17 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
$ tsdown
|
|
2
|
+
[34mℹ[39m tsdown [2mv0.20.3[22m powered by rolldown [2mv1.0.0-rc.3[22m
|
|
3
|
+
[34mℹ[39m config file: [4m/home/runner/work/kunk/kunk/packages/test/tsdown.config.ts[24m (unrun)
|
|
4
|
+
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
5
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
6
|
+
[34mℹ[39m Build start
|
|
7
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m0.55 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
8
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m0.21 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
9
|
+
[34mℹ[39m 2 files, total: 0.76 kB
|
|
10
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
11
|
+
|
|
12
|
+
[32m✔[39m Build complete in [32m7927ms[39m
|
package/CHANGELOG.md
ADDED
package/dist/index.d.mts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{afterAll,afterEach,expect,mock,setDefaultTimeout,setSystemTime}from"bun:test";import{PostgresContainer}from"@kunk/docker";setSystemTime(new Date(`2025-03-01T09:00:00.000Z`)),setDefaultTimeout(1e4);const databaseContainer=await PostgresContainer.start();afterAll(async()=>{await databaseContainer.stop()}),afterEach(async()=>{mock.clearAllMocks(),mock.restore()});function expectToMatchObject(e,t){return expect(e).toMatchObject(t)}async function CLEAR_TEST_DATA(){await databaseContainer.clear()}export{CLEAR_TEST_DATA,expectToMatchObject};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kunk/test",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"module": "./src/index.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsdown"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@kunk/database": "workspace:*",
|
|
13
|
+
"@kunk/server": "workspace:*",
|
|
14
|
+
"@kunk/api": "workspace:*",
|
|
15
|
+
"@kunk/model": "workspace:*",
|
|
16
|
+
"@kunk/docker": "workspace:*"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
}
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { databaseContainer } from "./setup"
|
|
2
|
+
import { expect } from "bun:test"
|
|
3
|
+
|
|
4
|
+
export function expectToMatchObject<T>(from: T, toMatch: Partial<T>) {
|
|
5
|
+
return expect(from).toMatchObject(toMatch)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function CLEAR_TEST_DATA() {
|
|
9
|
+
await databaseContainer.clear()
|
|
10
|
+
}
|
package/src/setup.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { afterAll, setDefaultTimeout, mock, afterEach, setSystemTime } from "bun:test"
|
|
2
|
+
import { PostgresContainer } from "@kunk/docker"
|
|
3
|
+
|
|
4
|
+
setSystemTime(new Date("2025-03-01T09:00:00.000Z"))
|
|
5
|
+
setDefaultTimeout(10000)
|
|
6
|
+
|
|
7
|
+
export const databaseContainer = await PostgresContainer.start()
|
|
8
|
+
|
|
9
|
+
afterAll(async () => {
|
|
10
|
+
await databaseContainer.stop()
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
afterEach(async () => {
|
|
14
|
+
mock.clearAllMocks()
|
|
15
|
+
mock.restore()
|
|
16
|
+
})
|
package/tsconfig.json
ADDED
package/tsdown.config.ts
ADDED