@zohodesk/testinglibrary 0.1.8-stb-bdd-v26 → 0.1.9
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 +21 -18
- package/.eslintrc.js +31 -31
- package/.prettierrc +5 -5
- package/README.md +17 -17
- package/bin/cli.js +2 -2
- package/build/bdd-framework/cli/commands/env.js +42 -0
- package/build/bdd-framework/cli/commands/export.js +47 -0
- package/build/bdd-framework/cli/commands/test.js +64 -0
- package/build/bdd-framework/cli/index.js +11 -0
- package/build/bdd-framework/cli/options.js +19 -0
- package/build/bdd-framework/cli/worker.js +13 -0
- package/build/bdd-framework/config/configDir.js +35 -0
- package/build/bdd-framework/config/enrichReporterData.js +23 -0
- package/build/bdd-framework/config/env.js +50 -0
- package/build/bdd-framework/config/index.js +94 -0
- package/build/bdd-framework/config/lang.js +14 -0
- package/build/bdd-framework/cucumber/buildStepDefinition.js +43 -0
- package/build/bdd-framework/cucumber/createTestStep.js +43 -0
- package/build/bdd-framework/cucumber/formatter/EventDataCollector.js +126 -0
- package/build/bdd-framework/cucumber/formatter/GherkinDocumentParser.js +72 -0
- package/build/bdd-framework/cucumber/formatter/PickleParser.js +25 -0
- package/build/bdd-framework/cucumber/formatter/durationHelpers.js +13 -0
- package/build/bdd-framework/cucumber/formatter/getColorFns.js +57 -0
- package/build/bdd-framework/cucumber/formatter/index.js +16 -0
- package/build/bdd-framework/cucumber/formatter/locationHelpers.js +16 -0
- package/build/bdd-framework/cucumber/loadConfig.js +17 -0
- package/build/bdd-framework/cucumber/loadFeatures.js +70 -0
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +20 -0
- package/build/bdd-framework/cucumber/loadSteps.js +47 -0
- package/build/bdd-framework/cucumber/resolveFeaturePaths.js +62 -0
- package/build/bdd-framework/cucumber/stepArguments.js +21 -0
- package/build/bdd-framework/cucumber/types.js +5 -0
- package/build/bdd-framework/cucumber/valueChecker.js +23 -0
- package/build/bdd-framework/decorators.js +18 -0
- package/build/bdd-framework/gen/fixtures.js +48 -0
- package/build/bdd-framework/gen/formatter.js +123 -0
- package/build/bdd-framework/gen/i18n.js +39 -0
- package/build/bdd-framework/gen/index.js +185 -0
- package/build/bdd-framework/gen/testFile.js +465 -0
- package/build/bdd-framework/gen/testMeta.js +60 -0
- package/build/bdd-framework/gen/testNode.js +60 -0
- package/build/bdd-framework/gen/testPoms.js +133 -0
- package/build/bdd-framework/hooks/scenario.js +130 -0
- package/build/bdd-framework/hooks/worker.js +89 -0
- package/build/bdd-framework/index.js +52 -0
- package/build/bdd-framework/playwright/fixtureParameterNames.js +93 -0
- package/build/bdd-framework/playwright/getLocationInFile.js +79 -0
- package/build/bdd-framework/playwright/loadConfig.js +42 -0
- package/build/bdd-framework/playwright/loadUtils.js +33 -0
- package/build/bdd-framework/playwright/testTypeImpl.js +61 -0
- package/build/bdd-framework/playwright/transform.js +88 -0
- package/build/bdd-framework/playwright/types.js +5 -0
- package/build/bdd-framework/playwright/utils.js +34 -0
- package/build/bdd-framework/reporter/cucumber/base.js +57 -0
- package/build/bdd-framework/reporter/cucumber/custom.js +73 -0
- package/build/bdd-framework/reporter/cucumber/helper.js +12 -0
- package/build/bdd-framework/reporter/cucumber/html.js +35 -0
- package/build/bdd-framework/reporter/cucumber/index.js +74 -0
- package/build/bdd-framework/reporter/cucumber/json.js +312 -0
- package/build/bdd-framework/reporter/cucumber/junit.js +205 -0
- package/build/bdd-framework/reporter/cucumber/message.js +20 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/AttachmentMapper.js +64 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Builder.js +196 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocument.js +43 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocumentClone.js +52 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocuments.js +105 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Hook.js +70 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Meta.js +45 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Pickles.js +27 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Projects.js +38 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCase.js +128 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRun.js +126 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRunHooks.js +102 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +50 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +88 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/index.js +30 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/pwUtils.js +51 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/timing.js +35 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/types.js +5 -0
- package/build/bdd-framework/run/StepInvoker.js +68 -0
- package/build/bdd-framework/run/bddDataAttachment.js +46 -0
- package/build/bdd-framework/run/bddFixtures.js +191 -0
- package/build/bdd-framework/run/bddWorld.js +79 -0
- package/build/bdd-framework/run/bddWorldInternal.js +15 -0
- package/build/bdd-framework/snippets/index.js +132 -0
- package/build/bdd-framework/snippets/snippetSyntax.js +43 -0
- package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +26 -0
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +18 -0
- package/build/bdd-framework/stepDefinitions/createBdd.js +66 -0
- package/build/bdd-framework/stepDefinitions/decorators/class.js +68 -0
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +99 -0
- package/build/bdd-framework/stepDefinitions/defineStep.js +62 -0
- package/build/bdd-framework/stepDefinitions/stepConfig.js +24 -0
- package/build/bdd-framework/utils/AutofillMap.js +20 -0
- package/build/bdd-framework/utils/exit.js +62 -0
- package/build/bdd-framework/utils/index.js +93 -0
- package/build/bdd-framework/utils/jsStringWrap.js +44 -0
- package/build/bdd-framework/utils/logger.js +30 -0
- package/build/bdd-framework/utils/stripAnsiEscapes.js +20 -0
- package/build/core/playwright/builtInFixtures/addTags.js +1 -1
- package/build/core/playwright/builtInFixtures/context.js +18 -1
- package/build/core/playwright/builtInFixtures/i18N.js +33 -0
- package/build/core/playwright/builtInFixtures/index.js +19 -7
- package/build/core/playwright/builtInFixtures/page.js +69 -39
- package/build/core/playwright/builtInFixtures/unauthenticatedPage.js +18 -0
- package/build/core/playwright/clear-caches.js +19 -8
- package/build/core/playwright/codegen.js +4 -4
- package/build/core/playwright/constants/browserTypes.js +12 -0
- package/build/core/playwright/custom-commands.js +1 -1
- package/build/core/playwright/env-initializer.js +10 -6
- package/build/core/playwright/helpers/auth/accountLogin.js +18 -0
- package/build/core/playwright/helpers/auth/checkAuthCookies.js +47 -0
- package/build/core/playwright/helpers/auth/getUrlOrigin.js +13 -0
- package/build/core/playwright/helpers/auth/getUsers.js +72 -0
- package/build/core/playwright/helpers/auth/index.js +58 -0
- package/build/core/playwright/helpers/auth/loginSteps.js +36 -0
- package/build/core/playwright/helpers/configFileNameProvider.js +17 -0
- package/build/core/playwright/helpers/getUserFixtures.js +23 -0
- package/build/core/playwright/helpers/mergeObjects.js +13 -0
- package/build/core/playwright/helpers/parseUserArgs.js +11 -0
- package/build/core/playwright/index.js +69 -15
- package/build/core/playwright/readConfigFile.js +50 -39
- package/build/core/playwright/report-generator.js +7 -7
- package/build/core/playwright/setup/config-creator.js +15 -16
- package/build/core/playwright/setup/config-utils.js +60 -26
- package/build/core/playwright/setup/custom-reporter.js +3 -2
- package/build/core/playwright/tag-processor.js +12 -23
- package/build/core/playwright/test-runner.js +49 -63
- package/build/core/playwright/types.js +43 -0
- package/build/decorators.d.ts +1 -1
- package/build/decorators.js +16 -2
- package/build/index.d.ts +79 -12
- package/build/index.js +51 -9
- package/build/lib/cli.js +12 -3
- package/build/lib/post-install.js +18 -10
- package/build/parser/sample.feature +34 -34
- package/build/parser/sample.spec.js +18 -18
- package/build/setup-folder-structure/helper.js +3 -0
- package/build/setup-folder-structure/reportEnhancement/addonScript.html +24 -24
- 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 +36 -36
- package/build/setup-folder-structure/samples/uat-config-sample.js +44 -44
- package/build/utils/cliArgsToObject.js +30 -26
- package/build/utils/fileUtils.js +4 -19
- package/build/utils/getFilePath.js +1 -2
- package/build/utils/rootPath.js +16 -9
- package/changelog.md +144 -131
- package/jest.config.js +63 -63
- package/npm-shrinkwrap.json +6475 -5994
- package/package.json +57 -56
- package/playwright.config.js +112 -112
- package/build/bdd-poc/config/pathConfig.js +0 -22
- package/build/bdd-poc/core-runner/exportMethods.js +0 -22
- package/build/bdd-poc/core-runner/main.js +0 -15
- package/build/bdd-poc/core-runner/stepDefinitions.js +0 -157
- package/build/bdd-poc/core-runner/stepRunner.js +0 -25
- package/build/bdd-poc/errors/throwError.js +0 -23
- package/build/bdd-poc/index.js +0 -26
- package/build/bdd-poc/test/cucumber/featureFileParer.js +0 -84
- package/build/bdd-poc/test/cucumber/parserCucumber.js +0 -15
- package/build/bdd-poc/test/stepGenerate/extractTestInputs.js +0 -65
- package/build/bdd-poc/test/stepGenerate/parserSteps.js +0 -81
- package/build/bdd-poc/test/stepGenerate/stepFileGenerate.js +0 -40
- package/build/bdd-poc/test/stepGenerate/stepsnippets.js +0 -61
- package/build/bdd-poc/test/tagsHandle.js +0 -70
- package/build/bdd-poc/test/testData.js +0 -125
- package/build/bdd-poc/test/testStructure.js +0 -92
- package/build/bdd-poc/utils/stringManipulation.js +0 -26
package/changelog.md
CHANGED
|
@@ -1,131 +1,144 @@
|
|
|
1
|
-
# Testing Framework
|
|
2
|
-
|
|
3
|
-
## Framework that abstracts the configuration for playwright and Jest
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Added
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# 0.1.
|
|
36
|
-
|
|
37
|
-
**Enhancements**
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# 0.0.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
1
|
+
# Testing Framework
|
|
2
|
+
|
|
3
|
+
## Framework that abstracts the configuration for playwright and Jest
|
|
4
|
+
|
|
5
|
+
# 0.1.9
|
|
6
|
+
**Enhancements**
|
|
7
|
+
- Added option to specify browsers in command line.
|
|
8
|
+
- npm run uat -- --browsers='chrome,firefox'
|
|
9
|
+
- Playwright version updated to 1.41.1
|
|
10
|
+
- Added option to Skip Browser download
|
|
11
|
+
- Added New Command re-run-failed to run only the failed cases
|
|
12
|
+
**Major Change**
|
|
13
|
+
- Default fixtures moved inside the library.(Page, Context, i18N, unauthenticatedPage)
|
|
14
|
+
**Internal Library Change**
|
|
15
|
+
Examples folder updated to latest testing library version.
|
|
16
|
+
|
|
17
|
+
# 0.1.8
|
|
18
|
+
**Issue Fixes**
|
|
19
|
+
- Fix #9 Custom report generate Error on Windows
|
|
20
|
+
- Add Tags annotations only on bddMode
|
|
21
|
+
|
|
22
|
+
**Enhancements**
|
|
23
|
+
- Added Failed steps in test summary
|
|
24
|
+
|
|
25
|
+
# 0.1.7
|
|
26
|
+
**Enhancements**
|
|
27
|
+
- Added option to run teardown logic.
|
|
28
|
+
- Added support for tag based filtering.
|
|
29
|
+
- Playwright-bdd version updated to 5.6.0.
|
|
30
|
+
- New fixture added to add tag as annotations in test report
|
|
31
|
+
|
|
32
|
+
**Issue Fixes**
|
|
33
|
+
- Edition command option. Fixed the edition tags not generated properly
|
|
34
|
+
|
|
35
|
+
# 0.1.6
|
|
36
|
+
|
|
37
|
+
**Enhancements**
|
|
38
|
+
- New Command option Added `--edition`.
|
|
39
|
+
- New Configuration Added `editionOrder`.
|
|
40
|
+
`In uat.config.js, editionOrder: ['Free', 'Express']`
|
|
41
|
+
- Cache Layer added
|
|
42
|
+
|
|
43
|
+
**USAGE**
|
|
44
|
+
- npm run uat --edition="Free"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# 0.1.5
|
|
49
|
+
|
|
50
|
+
**Enhancements**
|
|
51
|
+
|
|
52
|
+
- Playwright version updated to `1.40.1`
|
|
53
|
+
- And and But Support added
|
|
54
|
+
- Added Code Suggestions support
|
|
55
|
+
- Custom Reporter added. Now the report will be available in json format.
|
|
56
|
+
- New Commands added.
|
|
57
|
+
|
|
58
|
+
`- help: npx ZDTestingFramework help`
|
|
59
|
+
|
|
60
|
+
- Will list down the commands available in the tool
|
|
61
|
+
|
|
62
|
+
`- clearCaches: npx ZDTestingFramework clearCaches`
|
|
63
|
+
|
|
64
|
+
- Will clear the exisiting cookies in the authentication setup
|
|
65
|
+
|
|
66
|
+
**Issue Fixes**
|
|
67
|
+
|
|
68
|
+
- Fixed Issue that occurs while quitting node process.
|
|
69
|
+
|
|
70
|
+
# 0.1.4
|
|
71
|
+
|
|
72
|
+
- `testIdAttribute` config added
|
|
73
|
+
- Fixed issue while reading boolean configuration values
|
|
74
|
+
|
|
75
|
+
# 0.1.3
|
|
76
|
+
|
|
77
|
+
- uat config sample file updated with `bddMode` and `viewport` values
|
|
78
|
+
- user configuration issue fix when the value is undefined
|
|
79
|
+
|
|
80
|
+
# 0.1.2
|
|
81
|
+
|
|
82
|
+
- Bdd version updated to `5.4.0`
|
|
83
|
+
- Playwright version updated to `1.39.0`
|
|
84
|
+
|
|
85
|
+
# 0.1.1
|
|
86
|
+
|
|
87
|
+
- Fixed post install script error
|
|
88
|
+
- 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
|
|
89
|
+
- Removed testing library exports
|
|
90
|
+
|
|
91
|
+
# 0.1.0
|
|
92
|
+
|
|
93
|
+
- Removed eslint as dev dependencies as it causes `npm aliases not supported error` for npm version < 6
|
|
94
|
+
|
|
95
|
+
# 0.0.9
|
|
96
|
+
|
|
97
|
+
- Video sized in report adjusted to viewport size
|
|
98
|
+
- Changes in package.json scripts while setting up project
|
|
99
|
+
|
|
100
|
+
# 0.0.8
|
|
101
|
+
|
|
102
|
+
- Tags Support
|
|
103
|
+
- Enable running without bddmode feature
|
|
104
|
+
- viewport configuration
|
|
105
|
+
- Internal Change - Code refactoring
|
|
106
|
+
|
|
107
|
+
# 0.0.7
|
|
108
|
+
|
|
109
|
+
- Removed react and react-dom as dependencies. Added this as peer dependency
|
|
110
|
+
|
|
111
|
+
# 0.0.6
|
|
112
|
+
|
|
113
|
+
## Provided Initial Support for cucumber feature files
|
|
114
|
+
|
|
115
|
+
- Playwright-bdd and cucumber added as dependencies
|
|
116
|
+
- Added config bddMode which toggles the feature files processing
|
|
117
|
+
- Added expect timeout and test timeout as an option
|
|
118
|
+
- Decorators support for given, when and then. Typescript support needed to use this feature
|
|
119
|
+
|
|
120
|
+
## Internal Library change
|
|
121
|
+
|
|
122
|
+
- Provided support for import/export statements
|
|
123
|
+
|
|
124
|
+
# 0.0.5
|
|
125
|
+
|
|
126
|
+
- Added Init command to initialize the folder structure and configuration for testing
|
|
127
|
+
- Renamed config.json to env-config.json
|
|
128
|
+
- Configured report file path directory and Handled Edge case in Cookies Handling
|
|
129
|
+
|
|
130
|
+
# 0.0.4
|
|
131
|
+
|
|
132
|
+
- Issue Fixes while loading the storage state
|
|
133
|
+
|
|
134
|
+
# 0.0.3
|
|
135
|
+
|
|
136
|
+
- Added Support for custom config generator based on user preferences
|
|
137
|
+
|
|
138
|
+
# 0.0.2
|
|
139
|
+
|
|
140
|
+
- Fix for Finding directories inside node_modules folder
|
|
141
|
+
|
|
142
|
+
# 0.0.1
|
|
143
|
+
|
|
144
|
+
- 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
|
};
|