[IMP] app: introduce test mode

Same as `dev` mode, but without warning in console
This commit is contained in:
Géry Debongnie
2022-01-28 13:39:03 +01:00
committed by Aaron Bohy
parent a7305a5cdb
commit 722abd6d5f
2 changed files with 26 additions and 17 deletions
+5 -1
View File
@@ -14,6 +14,7 @@ export interface Env {
export interface AppConfig<P, E> extends TemplateSetConfig {
props?: P;
env?: E;
test?: boolean;
}
export const DEV_MSG = `Owl is running in 'dev' mode.
@@ -35,7 +36,10 @@ export class App<
constructor(Root: ComponentConstructor<P, E>, config: AppConfig<P, E> = {}) {
super(config);
this.Root = Root;
if (config.dev) {
if (config.test) {
this.dev = true;
}
if (this.dev && !config.test) {
console.info(DEV_MSG);
}
const descrs = Object.getOwnPropertyDescriptors(config.env || {});