Skip to content

Commit 42ea7d4

Browse files
committed
test: setup global variables
1 parent c89a12c commit 42ea7d4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.mocharc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
recursive: true,
3-
require: ['@babel/register', '@babel/polyfill', './test/setup_jsdom.js']
3+
require: ['@babel/register', '@babel/polyfill', './test/setup_global.js', './test/setup_jsdom.js']
44
}

test/setup_global.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const pkg = require('../package.json');
2+
3+
global.process.env.NODE_ENV = 'production';
4+
global.process.env.BUILD = 'production';
5+
global.__buildDate__ = () => JSON.stringify(new Date());
6+
global.__buildVersion__ = JSON.stringify(pkg.version);

0 commit comments

Comments
 (0)