Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

jest.config.js 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
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
36
37
38
39
40
41
42
43
44
45
46
  1. // https://jestjs.io/docs/en/configuration.html
  2. const isBrowser = process.env.BROWSER
  3. const isActions = Boolean(process.env.GITHUB_ACTIONS)
  4. const testTranslation = Boolean(process.env.TEST_TRANSLATION)
  5. const reporters = ['default']
  6. if (testTranslation) {
  7. // only use custom reporter if we are linting translations
  8. reporters.push('<rootDir>/tests/helpers/lint-translation-reporter.js')
  9. } else if (isActions) {
  10. reporters.push('jest-github-actions-reporter')
  11. }
  12. module.exports = {
  13. coverageThreshold: {
  14. global: {
  15. branches: 95,
  16. functions: 95,
  17. lines: 95,
  18. statements: -5
  19. }
  20. },
  21. preset: isBrowser
  22. ? 'jest-puppeteer'
  23. : undefined,
  24. reporters,
  25. modulePathIgnorePatterns: [
  26. 'assets/'
  27. ],
  28. setupFilesAfterEnv: ['jest-expect-message'],
  29. ...isBrowser ? {} : { testEnvironment: 'node' },
  30. testPathIgnorePatterns: [
  31. 'node_modules/',
  32. 'vendor/',
  33. 'tests/fixtures/',
  34. 'tests/helpers/',
  35. 'tests/javascripts/',
  36. ...isBrowser ? [] : ['tests/browser/browser.js']
  37. ],
  38. testMatch: [
  39. '**/tests/**/*.js'
  40. ],
  41. testLocationInResults: isActions
  42. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...