@zohodesk/testinglibrary 0.1.7-exp.2 → 0.1.8-exp-bdd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +18 -18
- package/.eslintrc.js +27 -31
- package/.prettierrc +5 -5
- package/README.md +17 -17
- package/bin/cli.js +2 -2
- package/build/bdd-framework/cli/commands/env.js +4 -4
- package/build/bdd-framework/cli/commands/test.js +2 -6
- package/build/bdd-framework/cli/options.js +4 -4
- package/build/bdd-framework/cli/worker.js +3 -3
- package/build/bdd-framework/config/dir.js +6 -6
- package/build/bdd-framework/config/env.js +4 -5
- package/build/bdd-framework/config/index.js +2 -2
- package/build/bdd-framework/cucumber/buildStepDefinition.js +3 -3
- package/build/bdd-framework/cucumber/gherkin.d.ts +45 -0
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +3 -3
- package/build/bdd-framework/cucumber/loadSources.js +9 -9
- package/build/bdd-framework/cucumber/loadSteps.js +3 -8
- package/build/bdd-framework/decorators.js +2 -2
- package/build/bdd-framework/gen/formatter.js +17 -64
- package/build/bdd-framework/gen/i18n.js +5 -9
- package/build/bdd-framework/gen/index.js +8 -9
- package/build/bdd-framework/gen/poms.js +46 -0
- package/build/bdd-framework/gen/testFile.js +55 -121
- package/build/bdd-framework/gen/testNode.js +6 -19
- package/build/bdd-framework/gen/testPoms.js +39 -49
- package/build/bdd-framework/playwright/fixtureParameterNames.js +11 -27
- package/build/bdd-framework/playwright/getLocationInFile.js +11 -17
- package/build/bdd-framework/playwright/loadConfig.js +3 -3
- package/build/bdd-framework/playwright/testTypeImpl.js +15 -19
- package/build/bdd-framework/playwright/transform.js +6 -10
- package/build/bdd-framework/playwright/utils.js +6 -3
- package/build/bdd-framework/run/bddFixtures.js +55 -118
- package/build/bdd-framework/run/bddWorld.js +36 -24
- package/build/bdd-framework/snippets/index.js +3 -5
- package/build/bdd-framework/snippets/snippetSyntax.js +1 -3
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +4 -4
- package/build/bdd-framework/stepDefinitions/createBdd.js +13 -30
- package/build/bdd-framework/stepDefinitions/createDecorators.js +108 -0
- package/build/bdd-framework/stepDefinitions/decorators/{class.js → poms.js} +9 -13
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +8 -14
- package/build/bdd-framework/stepDefinitions/defineStep.js +4 -5
- package/build/bdd-framework/stepDefinitions/stepConfig.js +5 -5
- package/build/bdd-framework/utils/exit.js +18 -26
- package/build/bdd-framework/utils/index.js +4 -30
- package/build/bdd-framework/utils/jsStringWrap.js +9 -9
- package/build/bdd-framework/utils/logger.js +3 -5
- package/build/bdd-poc/core-runner/exportMethods.js +14 -0
- package/build/bdd-poc/core-runner/stepDefinitions.js +55 -0
- package/build/bdd-poc/main.js +10 -0
- package/build/bdd-poc/test/cucumber/featureFileParer.js +81 -0
- package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +36 -0
- package/build/bdd-poc/test/stepGenerate/stepsnippets.js +43 -0
- package/build/bdd-poc/test/testDataMap.js +98 -0
- package/build/bdd-poc/test/testStructure.js +83 -0
- package/build/bdd-poc/utils/stringManipulation.js +19 -0
- package/build/core/playwright/custom-commands.js +1 -1
- package/build/core/playwright/index.js +74 -6
- package/build/core/playwright/readConfigFile.js +30 -37
- package/build/core/playwright/report-generator.js +1 -2
- package/build/core/playwright/setup/config-creator.js +15 -21
- package/build/core/playwright/setup/config-utils.js +0 -30
- package/build/core/playwright/test-runner.js +5 -7
- package/build/index.d.ts +5 -60
- package/build/index.js +3 -5
- package/build/lib/cli.js +1 -10
- package/build/parser/sample.feature +34 -34
- package/build/parser/sample.spec.js +18 -18
- package/build/setup-folder-structure/samples/auth-setup-sample.js +72 -72
- package/build/setup-folder-structure/samples/authUsers-sample.json +8 -8
- package/build/setup-folder-structure/samples/env-config-sample.json +20 -20
- package/build/setup-folder-structure/samples/git-ignore.sample.js +32 -36
- package/build/setup-folder-structure/samples/uat-config-sample.js +43 -44
- package/build/setup-folder-structure/setupProject.js +5 -10
- package/build/utils/cliArgsToObject.js +25 -25
- package/build/utils/fileUtils.js +4 -15
- package/changelog.md +74 -124
- package/jest.config.js +63 -63
- package/npm-shrinkwrap.json +7781 -6469
- package/package.json +54 -55
- package/playwright.config.js +112 -112
- package/build/bdd-framework/config/lang.js +0 -14
- package/build/bdd-framework/gen/fixtures.js +0 -48
- package/build/bdd-framework/hooks/scenario.js +0 -107
- package/build/bdd-framework/hooks/worker.js +0 -83
- package/build/bdd-framework/run/StepInvoker.js +0 -73
- package/build/core/playwright/builtInFixtures/addTags.js +0 -19
- package/build/core/playwright/builtInFixtures/cacheLayer.js +0 -12
- package/build/core/playwright/builtInFixtures/context.js +0 -15
- package/build/core/playwright/builtInFixtures/index.js +0 -26
- package/build/core/playwright/builtInFixtures/page.js +0 -51
- package/build/core/playwright/clear-caches.js +0 -29
- package/build/core/playwright/setup/custom-reporter.js +0 -109
- package/build/core/playwright/tag-processor.js +0 -68
- package/build/setup-folder-structure/helper.js +0 -34
- package/build/setup-folder-structure/reportEnhancement/addonScript.html +0 -25
- package/build/setup-folder-structure/reportEnhancement/reportAlteration.js +0 -25
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.cliArgsToObject = cliArgsToObject;
|
|
7
7
|
exports.objectToCliArgs = objectToCliArgs;
|
|
8
|
-
/**
|
|
9
|
-
* Converts an array of command-line arguments into an object.
|
|
10
|
-
*
|
|
11
|
-
* @param {string[]} cliArgs - An array of command-line arguments.
|
|
12
|
-
* @param {boolean} [isKeyNeedToBeAdded=true] - Indicates whether the keys should be added to the resulting object.
|
|
13
|
-
* @returns {Object} An object representing the command-line arguments, where keys are argument names (without '--') and values are argument values.
|
|
14
|
-
* If `isKeyNeedToBeAdded` is set to `false`, only values are included in the object with numeric indexes as keys.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* // Example usage:
|
|
18
|
-
* const args = ['--port=8080', '--verbose', 'input.txt'];
|
|
19
|
-
* const result = cliArgsToObject(args);
|
|
20
|
-
* // result will be: { port: '8080', verbose: true }
|
|
8
|
+
/**
|
|
9
|
+
* Converts an array of command-line arguments into an object.
|
|
10
|
+
*
|
|
11
|
+
* @param {string[]} cliArgs - An array of command-line arguments.
|
|
12
|
+
* @param {boolean} [isKeyNeedToBeAdded=true] - Indicates whether the keys should be added to the resulting object.
|
|
13
|
+
* @returns {Object} An object representing the command-line arguments, where keys are argument names (without '--') and values are argument values.
|
|
14
|
+
* If `isKeyNeedToBeAdded` is set to `false`, only values are included in the object with numeric indexes as keys.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Example usage:
|
|
18
|
+
* const args = ['--port=8080', '--verbose', 'input.txt'];
|
|
19
|
+
* const result = cliArgsToObject(args);
|
|
20
|
+
* // result will be: { port: '8080', verbose: true }
|
|
21
21
|
*/
|
|
22
22
|
// eslint-disable-next-line no-unused-vars
|
|
23
23
|
function cliArgsToObject(cliArgs, isKeyNeedToBeAdded) {
|
|
@@ -37,18 +37,18 @@ function cliArgsToObject(cliArgs, isKeyNeedToBeAdded) {
|
|
|
37
37
|
return processEnv;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* Converts an object to an array of command-line arguments.
|
|
42
|
-
*
|
|
43
|
-
* @param {Object} objectToBeConverted - The object to be converted to command-line arguments.
|
|
44
|
-
* @param {(string|function(string): boolean)} [isKeyNeedToBeAdded=true] - A string representing a key, or a function that determines whether a key should be added to the resulting array.
|
|
45
|
-
* @returns {string[]} An array of command-line arguments generated from the object's key-value pairs. Keys are transformed into argument names (with '--') and values are added as argument values.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* // Example usage:
|
|
49
|
-
* const options = { port: 8080, verbose: true, input: 'input.txt' };
|
|
50
|
-
* const args = objectToCliArgs(options);
|
|
51
|
-
* // args will be: ['--port=8080', '--verbose', '--input=input.txt']
|
|
40
|
+
/**
|
|
41
|
+
* Converts an object to an array of command-line arguments.
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} objectToBeConverted - The object to be converted to command-line arguments.
|
|
44
|
+
* @param {(string|function(string): boolean)} [isKeyNeedToBeAdded=true] - A string representing a key, or a function that determines whether a key should be added to the resulting array.
|
|
45
|
+
* @returns {string[]} An array of command-line arguments generated from the object's key-value pairs. Keys are transformed into argument names (with '--') and values are added as argument values.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Example usage:
|
|
49
|
+
* const options = { port: 8080, verbose: true, input: 'input.txt' };
|
|
50
|
+
* const args = objectToCliArgs(options);
|
|
51
|
+
* // args will be: ['--port=8080', '--verbose', '--input=input.txt']
|
|
52
52
|
*/
|
|
53
53
|
function objectToCliArgs(objectToBeConverted, isKeyNeedToBeAdded) {
|
|
54
54
|
const argsArray = [];
|
package/build/utils/fileUtils.js
CHANGED
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.checkIfFileExists = checkIfFileExists;
|
|
8
8
|
exports.deleteFile = deleteFile;
|
|
9
|
-
exports.deleteFolder = deleteFolder;
|
|
10
9
|
exports.readFileContents = readFileContents;
|
|
11
10
|
exports.writeFileContents = writeFileContents;
|
|
12
11
|
var _fs = _interopRequireDefault(require("fs"));
|
|
13
|
-
var _path = _interopRequireDefault(require("path"));
|
|
14
12
|
function checkIfFileExists(file) {
|
|
15
13
|
try {
|
|
16
14
|
_fs.default.accessSync(file, _fs.default.constants.F_OK);
|
|
@@ -28,7 +26,9 @@ function readFileContents(filePath) {
|
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
function writeFileContents(filePath, content, writeOptions = {}) {
|
|
31
|
-
|
|
29
|
+
let filePaths = filePath.split('/');
|
|
30
|
+
let fileName = filePaths.pop();
|
|
31
|
+
let directoryPath = filePaths.join('/');
|
|
32
32
|
|
|
33
33
|
// Check if the directory exists
|
|
34
34
|
if (!_fs.default.existsSync(directoryPath)) {
|
|
@@ -37,7 +37,7 @@ function writeFileContents(filePath, content, writeOptions = {}) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
try {
|
|
40
|
-
_fs.default.writeFileSync(`${
|
|
40
|
+
_fs.default.writeFileSync(`${directoryPath}/${fileName}`, content, writeOptions);
|
|
41
41
|
} catch (err) {
|
|
42
42
|
throw new Error(err);
|
|
43
43
|
}
|
|
@@ -50,15 +50,4 @@ function deleteFile(filePath) {
|
|
|
50
50
|
throw new Error(`Error while deleting the test data file: ${filePath}`);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
}
|
|
54
|
-
function deleteFolder(folderPath) {
|
|
55
|
-
if (_fs.default.existsSync(folderPath)) {
|
|
56
|
-
try {
|
|
57
|
-
_fs.default.rmdirSync(folderPath, {
|
|
58
|
-
recursive: true
|
|
59
|
-
});
|
|
60
|
-
} catch (err) {
|
|
61
|
-
throw new Error(`Error while deleting the test data file: ${folderPath}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
53
|
}
|
package/changelog.md
CHANGED
|
@@ -1,124 +1,74 @@
|
|
|
1
|
-
# Testing Framework
|
|
2
|
-
|
|
3
|
-
## Framework that abstracts the configuration for playwright and Jest
|
|
4
|
-
|
|
5
|
-
# 0.1.
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
# 0.1.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
# 0.
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# 0.0.9
|
|
76
|
-
|
|
77
|
-
- Video sized in report adjusted to viewport size
|
|
78
|
-
- Changes in package.json scripts while setting up project
|
|
79
|
-
|
|
80
|
-
# 0.0.8
|
|
81
|
-
|
|
82
|
-
- Tags Support
|
|
83
|
-
- Enable running without bddmode feature
|
|
84
|
-
- viewport configuration
|
|
85
|
-
- Internal Change - Code refactoring
|
|
86
|
-
|
|
87
|
-
# 0.0.7
|
|
88
|
-
|
|
89
|
-
- Removed react and react-dom as dependencies. Added this as peer dependency
|
|
90
|
-
|
|
91
|
-
# 0.0.6
|
|
92
|
-
|
|
93
|
-
## Provided Initial Support for cucumber feature files
|
|
94
|
-
|
|
95
|
-
- Playwright-bdd and cucumber added as dependencies
|
|
96
|
-
- Added config bddMode which toggles the feature files processing
|
|
97
|
-
- Added expect timeout and test timeout as an option
|
|
98
|
-
- Decorators support for given, when and then. Typescript support needed to use this feature
|
|
99
|
-
|
|
100
|
-
## Internal Library change
|
|
101
|
-
|
|
102
|
-
- Provided support for import/export statements
|
|
103
|
-
|
|
104
|
-
# 0.0.5
|
|
105
|
-
|
|
106
|
-
- Added Init command to initialize the folder structure and configuration for testing
|
|
107
|
-
- Renamed config.json to env-config.json
|
|
108
|
-
- Configured report file path directory and Handled Edge case in Cookies Handling
|
|
109
|
-
|
|
110
|
-
# 0.0.4
|
|
111
|
-
|
|
112
|
-
- Issue Fixes while loading the storage state
|
|
113
|
-
|
|
114
|
-
# 0.0.3
|
|
115
|
-
|
|
116
|
-
- Added Support for custom config generator based on user preferences
|
|
117
|
-
|
|
118
|
-
# 0.0.2
|
|
119
|
-
|
|
120
|
-
- Fix for Finding directories inside node_modules folder
|
|
121
|
-
|
|
122
|
-
# 0.0.1
|
|
123
|
-
|
|
124
|
-
- test and report command support
|
|
1
|
+
# Testing Framework
|
|
2
|
+
|
|
3
|
+
## Framework that abstracts the configuration for playwright and Jest
|
|
4
|
+
|
|
5
|
+
# 0.1.3
|
|
6
|
+
|
|
7
|
+
- uat config sample file updated with `bddMode` and `viewport` values
|
|
8
|
+
- user configuration issue fix when the value is undefined
|
|
9
|
+
|
|
10
|
+
# 0.1.2
|
|
11
|
+
|
|
12
|
+
- Bdd version updated to `5.4.0`
|
|
13
|
+
- Playwright version updated to `1.39.0`
|
|
14
|
+
|
|
15
|
+
# 0.1.1
|
|
16
|
+
|
|
17
|
+
- Fixed post install script error
|
|
18
|
+
- Fixed error `@cucumber/gherkin` not found. Cause of this issue is updating @cucumber/cucumber to 9.5.0. Reverting this version to 9.2.0
|
|
19
|
+
- Removed testing library exports
|
|
20
|
+
|
|
21
|
+
# 0.1.0
|
|
22
|
+
|
|
23
|
+
- Removed eslint as dev dependencies as it causes `npm aliases not supported error` for npm version < 6
|
|
24
|
+
|
|
25
|
+
# 0.0.9
|
|
26
|
+
|
|
27
|
+
- Video sized in report adjusted to viewport size
|
|
28
|
+
- Changes in package.json scripts while setting up project
|
|
29
|
+
|
|
30
|
+
# 0.0.8
|
|
31
|
+
|
|
32
|
+
- Tags Support
|
|
33
|
+
- Enable running without bddmode feature
|
|
34
|
+
- viewport configuration
|
|
35
|
+
- Internal Change - Code refactoring
|
|
36
|
+
|
|
37
|
+
# 0.0.7
|
|
38
|
+
|
|
39
|
+
- Removed react and react-dom as dependencies. Added this as peer dependency
|
|
40
|
+
|
|
41
|
+
# 0.0.6
|
|
42
|
+
|
|
43
|
+
## Provided Initial Support for cucumber feature files
|
|
44
|
+
|
|
45
|
+
- Playwright-bdd and cucumber added as dependencies
|
|
46
|
+
- Added config bddMode which toggles the feature files processing
|
|
47
|
+
- Added expect timeout and test timeout as an option
|
|
48
|
+
- Decorators support for given, when and then. Typescript support needed to use this feature
|
|
49
|
+
|
|
50
|
+
## Internal Library change
|
|
51
|
+
|
|
52
|
+
- Provided support for import/export statements
|
|
53
|
+
|
|
54
|
+
# 0.0.5
|
|
55
|
+
|
|
56
|
+
- Added Init command to initialize the folder structure and configuration for testing
|
|
57
|
+
- Renamed config.json to env-config.json
|
|
58
|
+
- Configured report file path directory and Handled Edge case in Cookies Handling
|
|
59
|
+
|
|
60
|
+
# 0.0.4
|
|
61
|
+
|
|
62
|
+
- Issue Fixes while loading the storage state
|
|
63
|
+
|
|
64
|
+
# 0.0.3
|
|
65
|
+
|
|
66
|
+
- Added Support for custom config generator based on user preferences
|
|
67
|
+
|
|
68
|
+
# 0.0.2
|
|
69
|
+
|
|
70
|
+
- Fix for Finding directories inside node_modules folder
|
|
71
|
+
|
|
72
|
+
# 0.0.1
|
|
73
|
+
|
|
74
|
+
- test and report command support
|
package/jest.config.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const { existsSync } = require('fs');
|
|
3
|
-
const appPath = process.cwd();
|
|
4
|
-
|
|
5
|
-
const appGlobals = path.resolve(appPath, '__testUtils__', 'globals.js');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
rootDir: process.cwd(),
|
|
9
|
-
testEnvironment: 'jsdom',
|
|
10
|
-
|
|
11
|
-
setupFilesAfterEnv: [
|
|
12
|
-
existsSync(appGlobals) && appGlobals,
|
|
13
|
-
path.resolve(__dirname, 'src', 'core', 'jest', 'setup', 'index.js')
|
|
14
|
-
].filter(Boolean),
|
|
15
|
-
|
|
16
|
-
transform: {
|
|
17
|
-
'^.+\\.(js|jsx)$': path.resolve(
|
|
18
|
-
__dirname,
|
|
19
|
-
'src',
|
|
20
|
-
'core',
|
|
21
|
-
'jest',
|
|
22
|
-
'preprocessor',
|
|
23
|
-
'jsPreprocessor.js'
|
|
24
|
-
)
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
modulePathIgnorePatterns: ['/build/'],
|
|
28
|
-
|
|
29
|
-
transformIgnorePatterns: [
|
|
30
|
-
'/node_modules/(?!(@zohodesk)/)'
|
|
31
|
-
],
|
|
32
|
-
|
|
33
|
-
testPathIgnorePatterns: [
|
|
34
|
-
'/node_modules/',
|
|
35
|
-
'/build/',
|
|
36
|
-
'/uat/'
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
watchPathIgnorePatterns: [
|
|
40
|
-
'/node_modules/',
|
|
41
|
-
'/build/'
|
|
42
|
-
],
|
|
43
|
-
|
|
44
|
-
clearMocks: true,
|
|
45
|
-
resetMocks: false,
|
|
46
|
-
|
|
47
|
-
collectCoverage: true,
|
|
48
|
-
collectCoverageFrom: ['src/**/*.js'],
|
|
49
|
-
coverageDirectory: './build/cov',
|
|
50
|
-
coverageReporters: ['lcov', 'json', 'html', 'json-summary', 'text'],
|
|
51
|
-
coverageThreshold: {
|
|
52
|
-
global: {
|
|
53
|
-
branches: 100,
|
|
54
|
-
functions: 100,
|
|
55
|
-
lines: 100,
|
|
56
|
-
statements: 100
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
globals: {
|
|
60
|
-
__DEVELOPMENT__: true,
|
|
61
|
-
__DOCS__: false,
|
|
62
|
-
__TEST__: true
|
|
63
|
-
}
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { existsSync } = require('fs');
|
|
3
|
+
const appPath = process.cwd();
|
|
4
|
+
|
|
5
|
+
const appGlobals = path.resolve(appPath, '__testUtils__', 'globals.js');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
rootDir: process.cwd(),
|
|
9
|
+
testEnvironment: 'jsdom',
|
|
10
|
+
|
|
11
|
+
setupFilesAfterEnv: [
|
|
12
|
+
existsSync(appGlobals) && appGlobals,
|
|
13
|
+
path.resolve(__dirname, 'src', 'core', 'jest', 'setup', 'index.js')
|
|
14
|
+
].filter(Boolean),
|
|
15
|
+
|
|
16
|
+
transform: {
|
|
17
|
+
'^.+\\.(js|jsx)$': path.resolve(
|
|
18
|
+
__dirname,
|
|
19
|
+
'src',
|
|
20
|
+
'core',
|
|
21
|
+
'jest',
|
|
22
|
+
'preprocessor',
|
|
23
|
+
'jsPreprocessor.js'
|
|
24
|
+
)
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
modulePathIgnorePatterns: ['/build/'],
|
|
28
|
+
|
|
29
|
+
transformIgnorePatterns: [
|
|
30
|
+
'/node_modules/(?!(@zohodesk)/)'
|
|
31
|
+
],
|
|
32
|
+
|
|
33
|
+
testPathIgnorePatterns: [
|
|
34
|
+
'/node_modules/',
|
|
35
|
+
'/build/',
|
|
36
|
+
'/uat/'
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
watchPathIgnorePatterns: [
|
|
40
|
+
'/node_modules/',
|
|
41
|
+
'/build/'
|
|
42
|
+
],
|
|
43
|
+
|
|
44
|
+
clearMocks: true,
|
|
45
|
+
resetMocks: false,
|
|
46
|
+
|
|
47
|
+
collectCoverage: true,
|
|
48
|
+
collectCoverageFrom: ['src/**/*.js'],
|
|
49
|
+
coverageDirectory: './build/cov',
|
|
50
|
+
coverageReporters: ['lcov', 'json', 'html', 'json-summary', 'text'],
|
|
51
|
+
coverageThreshold: {
|
|
52
|
+
global: {
|
|
53
|
+
branches: 100,
|
|
54
|
+
functions: 100,
|
|
55
|
+
lines: 100,
|
|
56
|
+
statements: 100
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
globals: {
|
|
60
|
+
__DEVELOPMENT__: true,
|
|
61
|
+
__DOCS__: false,
|
|
62
|
+
__TEST__: true
|
|
63
|
+
}
|
|
64
64
|
};
|