mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] app: introduce test mode
Same as `dev` mode, but without warning in console
This commit is contained in:
committed by
Aaron Bohy
parent
a7305a5cdb
commit
722abd6d5f
+5
-1
@@ -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 || {});
|
||||
|
||||
Reference in New Issue
Block a user