mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Moving config during testing to tests asset folder #587
This commit is contained in:
parent
a58d61f958
commit
6134a7d35e
14
package-lock.json
generated
14
package-lock.json
generated
@ -27,7 +27,7 @@
|
|||||||
"sharp": "0.31.3",
|
"sharp": "0.31.3",
|
||||||
"ts-exif-parser": "0.2.2",
|
"ts-exif-parser": "0.2.2",
|
||||||
"ts-node-iptc": "1.0.11",
|
"ts-node-iptc": "1.0.11",
|
||||||
"typeconfig": "2.0.38",
|
"typeconfig": "2.0.39",
|
||||||
"typeorm": "0.3.12",
|
"typeorm": "0.3.12",
|
||||||
"xml2js": "0.4.23"
|
"xml2js": "0.4.23"
|
||||||
},
|
},
|
||||||
@ -21670,9 +21670,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typeconfig": {
|
"node_modules/typeconfig": {
|
||||||
"version": "2.0.38",
|
"version": "2.0.39",
|
||||||
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.38.tgz",
|
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.39.tgz",
|
||||||
"integrity": "sha512-yN9rRqJQ21xAYdR/1vhv4DPurOA7DNCN7zqPDPD6ZA2fLKcNTRa2flG/z2FaQE4UuBfnQ1o96c50xeNozDMbZQ==",
|
"integrity": "sha512-Wys54XBKXeUSfaqrPajTCi6lY3c1b/M/PotGWVL5KT6393IO317wq45F/5otFBuFVREIh+4gRG6c/y+SvSZXYw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "1.2.8"
|
"minimist": "1.2.8"
|
||||||
}
|
}
|
||||||
@ -39736,9 +39736,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typeconfig": {
|
"typeconfig": {
|
||||||
"version": "2.0.38",
|
"version": "2.0.39",
|
||||||
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.38.tgz",
|
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.39.tgz",
|
||||||
"integrity": "sha512-yN9rRqJQ21xAYdR/1vhv4DPurOA7DNCN7zqPDPD6ZA2fLKcNTRa2flG/z2FaQE4UuBfnQ1o96c50xeNozDMbZQ==",
|
"integrity": "sha512-Wys54XBKXeUSfaqrPajTCi6lY3c1b/M/PotGWVL5KT6393IO317wq45F/5otFBuFVREIh+4gRG6c/y+SvSZXYw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "1.2.8"
|
"minimist": "1.2.8"
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
"sharp": "0.31.3",
|
"sharp": "0.31.3",
|
||||||
"ts-exif-parser": "0.2.2",
|
"ts-exif-parser": "0.2.2",
|
||||||
"ts-node-iptc": "1.0.11",
|
"ts-node-iptc": "1.0.11",
|
||||||
"typeconfig": "2.0.38",
|
"typeconfig": "2.0.39",
|
||||||
"xml2js": "0.4.23",
|
"xml2js": "0.4.23",
|
||||||
"typeorm": "0.3.12"
|
"typeorm": "0.3.12"
|
||||||
},
|
},
|
||||||
|
@ -10,9 +10,13 @@ import {TAGS} from '../public/ClientConfig';
|
|||||||
declare const process: any;
|
declare const process: any;
|
||||||
|
|
||||||
const upTime = new Date().toISOString();
|
const upTime = new Date().toISOString();
|
||||||
|
// TODO: Refactor Config to be injectable globally.
|
||||||
|
// This is a bad habit to let the Config know if its in a testing env.
|
||||||
|
const isTesting = ['afterEach', 'after', 'beforeEach', 'before', 'describe', 'it']
|
||||||
|
.every((fn) => (global as any)[fn] instanceof Function);
|
||||||
|
|
||||||
@ConfigClass<IConfigClass<TAGS> & ServerConfig>({
|
@ConfigClass<IConfigClass<TAGS> & ServerConfig>({
|
||||||
configPath: path.join(__dirname, './../../../../config.json'),
|
configPath: path.join(__dirname, !isTesting ? './../../../../config.json' : './../../../../test/backend/assets/config.json'),
|
||||||
saveIfNotExist: true,
|
saveIfNotExist: true,
|
||||||
attachDescription: true,
|
attachDescription: true,
|
||||||
enumsAsString: true,
|
enumsAsString: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user