Skip to content

Commit

Permalink
add vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
slemke committed Apr 8, 2024
1 parent 9814f1f commit 97e2266
Show file tree
Hide file tree
Showing 10 changed files with 1,340 additions and 16 deletions.
1,324 changes: 1,317 additions & 7 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"description": "Run a Keycloak testcontainer with node.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"build": "tsc",
"lint": "eslint . --ext .ts",
"test": "jest --coverage"
"test": "vitest"
},
"engines": {
"node": ">=16.0.0",
Expand Down Expand Up @@ -47,7 +48,8 @@
"jest": "29.7.0",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"typescript": "5.4.4"
"typescript": "5.4.4",
"vitest": "1.4.0"
},
"dependencies": {
"testcontainers": "10.8.1"
Expand Down
8 changes: 4 additions & 4 deletions src/container/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {
GenericContainer,
Wait
} from 'testcontainers';
import { CommandsBuilder, DatabaseOptions } from '../configuration/commands';
import { AdminUser, EnvironmentBuilder } from '../configuration/environment';
import { Keycloak } from '../keycloak';
import { StartedKeycloakContainer } from './started-container';
import { CommandsBuilder, DatabaseOptions } from '../configuration/commands.js';
import { AdminUser, EnvironmentBuilder } from '../configuration/environment.js';
import { Keycloak } from '../keycloak.js';
import { StartedKeycloakContainer } from './started-container.js';

export class KeycloakContainer extends GenericContainer {

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KeycloakContainer } from './container/container';
import { StartedKeycloakContainer } from './container/started-container';
import { KeycloakContainer } from './container/container.js';
import { StartedKeycloakContainer } from './container/started-container.js';

export { StartedKeycloakContainer };
export default KeycloakContainer;
1 change: 1 addition & 0 deletions test/configuration/commands.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest'
import { CommandsBuilder } from '../../src/configuration/commands';

describe('Commands Builder', () => {
Expand Down
1 change: 1 addition & 0 deletions test/configuration/environment.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it } from 'vitest';
import { EnvironmentBuilder } from '../../src/configuration/environment';

describe('Environment Builder', () => {
Expand Down
1 change: 1 addition & 0 deletions test/container/container.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, it, afterEach } from 'vitest';
import axios from 'axios';
import { Wait } from 'testcontainers';
import KeycloakContainer, { StartedKeycloakContainer } from '../../src';
Expand Down
1 change: 1 addition & 0 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it } from 'vitest'
import KeycloakContainer from '../src';

describe('Import', () => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"module": "NodeNext",
"declaration": true,
"baseUrl": "./src",
"outDir": "./dist",
"esModuleInterop": true,
"moduleResolution": "NodeNext",
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
Expand Down
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
testTimeout: 60000
},
})

0 comments on commit 97e2266

Please sign in to comment.