parent
1167e99c30
commit
d423d78f2a
@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
tsconfig: 'tsconfig.test.json',
|
||||
@ -17,4 +17,5 @@ module.exports = {
|
||||
],
|
||||
testEnvironment: 'node',
|
||||
testTimeout: 60000,
|
||||
resolver: "jest-ts-webcompat-resolver",
|
||||
};
|
||||
|
@ -62,6 +62,8 @@
|
||||
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||
"eslint-plugin-svelte3": "^3.1.2",
|
||||
"jest": "^26.1.0",
|
||||
"jest-resolve": "^26.6.2",
|
||||
"jest-ts-webcompat-resolver": "^1.0.0",
|
||||
"maildev": "^1.1.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"nodemon": "^2.0.6",
|
||||
|
@ -18,7 +18,7 @@ import Extendable from "./Extendable.js";
|
||||
import {BadRequestError, HttpError, NotFoundHttpError, ServerError, ServiceUnavailableHttpError} from "./HttpError.js";
|
||||
import {logger, loggingContextMiddleware} from "./Logger.js";
|
||||
import SecurityError from "./SecurityError.js";
|
||||
import {Type} from "./Utils.js";
|
||||
import {doesFileExist, Type} from "./Utils.js";
|
||||
import WebSocketListener from "./WebSocketListener.js";
|
||||
import TemplateError = nunjucks.lib.TemplateError;
|
||||
|
||||
@ -69,7 +69,7 @@ export default abstract class Application implements Extendable<ApplicationCompo
|
||||
this.busy = true;
|
||||
|
||||
// Load core version
|
||||
const file = this.isInNodeModules() ?
|
||||
const file = await this.isInNodeModules() ?
|
||||
'node_modules/swaf/package.json' :
|
||||
'package.json';
|
||||
|
||||
@ -378,8 +378,8 @@ export default abstract class Application implements Extendable<ApplicationCompo
|
||||
return module ? module as C : null;
|
||||
}
|
||||
|
||||
public isInNodeModules(): boolean {
|
||||
return path.dirname(url.fileURLToPath(import.meta.url)).endsWith('/node_modules/swaf');
|
||||
public async isInNodeModules(): Promise<boolean> {
|
||||
return !await doesFileExist('node_modules/swaf');
|
||||
}
|
||||
|
||||
public isReady(): boolean {
|
||||
|
@ -4347,6 +4347,11 @@ jest-snapshot@^26.6.2:
|
||||
pretty-format "^26.6.2"
|
||||
semver "^7.3.2"
|
||||
|
||||
jest-ts-webcompat-resolver@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jest-ts-webcompat-resolver/-/jest-ts-webcompat-resolver-1.0.0.tgz#a554eb77446e1a8d2aabb810d6302bffaa00095c"
|
||||
integrity sha512-BFoaU7LeYqZNnTYEr6iMRf87xdCQntNc/Wk8YpzDBcuz+CIZ0JsTtzuMAMnKiEgTRTC1wRWLUo2RlVjVijBcHQ==
|
||||
|
||||
jest-util@^26.1.0, jest-util@^26.6.2:
|
||||
version "26.6.2"
|
||||
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-26.6.2.tgz#907535dbe4d5a6cb4c47ac9b926f6af29576cbc1"
|
||||
|
Loading…
Reference in New Issue
Block a user