Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dziraf committed Mar 15, 2023
1 parent d581176 commit 3bb5d20
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"build": "rm -rf lib && tsc",
"example:simple": "nodemon",
"example:auth": "nodemon --config nodemon.auth.json",
"test": "jest --config ./test/jest.json",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --config ./jest.json --runInBand --detectOpenHandles",
"lint": "eslint './**/*.ts'",
"check:all": "yarn lint && yarn build && yarn test",
"release": "semantic-release"
Expand Down Expand Up @@ -51,6 +51,7 @@
"devDependencies": {
"@adminjs/mongoose": "^3.0.1",
"@commitlint/config-conventional": "^17.4.4",
"@jest/globals": "^29.5.0",
"@semantic-release/git": "^9.0.0",
"@types/express": "^4.17.17",
"@types/express-formidable": "^1.2.0",
Expand All @@ -60,7 +61,6 @@
"@typescript-eslint/parser": "^5.53.0",
"adminjs": "^6.0.0",
"commitlint": "^17.4.4",
"dotenv-cli": "^7.1.0",
"eslint": "^8.35.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.6.0",
Expand Down
6 changes: 5 additions & 1 deletion test/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import AdminJS from "adminjs";
import { AdminJS } from "adminjs";
import express from "express";
import { jest } from "@jest/globals";

import { buildRouter } from "../src/buildRouter";

jest.useFakeTimers();

describe("plugin", () => {
describe(".buildRouter", () => {
it("returns an express router when AdminJS instance given as an argument", () => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"noImplicitThis": true,
"moduleResolution": "nodenext",
"baseUrl": "./",
"typeRoots": ["./src/typings", "./node_modules/@types"]
"typeRoots": ["./src/typings", "./node_modules/@types"],
"allowJs": true
},
"exclude": ["lib", "types", "test", "examples"]
}
20 changes: 0 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5693,26 +5693,6 @@ dot-prop@^5.1.0, dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"

dotenv-cli@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-7.1.0.tgz#9ff360f7d1de72389027d4d9e9deccb0ef151c5e"
integrity sha512-motytjZFQB3ZtGTIN4c0vnFgv4kuNZ2WxVnGY6PVFiygCzkm3IFBBguDUzezd9HgNA0OYYd6vNCWlozs0Q1Zxg==
dependencies:
cross-spawn "^7.0.3"
dotenv "^16.0.0"
dotenv-expand "^10.0.0"
minimist "^1.2.6"

dotenv-expand@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-10.0.0.tgz#12605d00fb0af6d0a592e6558585784032e4ef37"
integrity sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==

dotenv@^16.0.0:
version "16.0.3"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07"
integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==

dotenv@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
Expand Down

0 comments on commit 3bb5d20

Please sign in to comment.