@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.
@@ -0,0 +1,12 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
3
+ ℹ config file: /home/runner/work/kunk/kunk/packages/test/tsdown.config.ts (unrun)
4
+ ℹ entry: src/index.ts
5
+ ℹ tsconfig: tsconfig.json
6
+ ℹ Build start
7
+ ℹ dist/index.mjs 0.55 kB │ gzip: 0.32 kB
8
+ ℹ dist/index.d.mts 0.21 kB │ gzip: 0.17 kB
9
+ ℹ 2 files, total: 0.76 kB
10
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
11
+
12
+ ✔ Build complete in 7927ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # @kunk/test
2
+
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - version 2
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @kunk/database@3.0.0
13
+ - @kunk/docker@3.0.0
14
+ - @kunk/server@3.0.0
15
+ - @kunk/model@3.0.0
16
+ - @kunk/api@3.0.0
@@ -0,0 +1,5 @@
1
+ //#region src/index.d.ts
2
+ declare function expectToMatchObject<T>(from: T, toMatch: Partial<T>): void;
3
+ declare function CLEAR_TEST_DATA(): Promise<void>;
4
+ //#endregion
5
+ export { CLEAR_TEST_DATA, expectToMatchObject };
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
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "rootDir": ".",
4
+ "baseUrl": ".",
5
+ "module": "Preserve",
6
+ "target": "ESNext",
7
+ "paths": {
8
+ "@/*": ["./src/*"]
9
+ }
10
+ },
11
+ "include": [
12
+ "src/**/*.ts"
13
+ ],
14
+ "exclude": [
15
+ "node_modules",
16
+ "dist"
17
+ ]
18
+ }
@@ -0,0 +1,17 @@
1
+ import { defineConfig } from 'tsdown'
2
+
3
+ export default defineConfig({
4
+ entry: [
5
+ './src/index.ts'
6
+ ],
7
+ external: [
8
+ 'dockerode',
9
+ 'bun:test',
10
+ "drizzle-orm",
11
+ "drizzle-sdk",
12
+ ],
13
+ dts: true,
14
+ minify: {
15
+ mangle: true,
16
+ }
17
+ })