test: unit tests for commands/serve/web/connect.js file (#937)

* refactor: `connect()` and `openApp()`

* test: connect function covered

* chore: renaming jests test commands

* chore: adding override rule for non `commands/serve` directories to skip jest rules

* test: openApp() covered

* test: `getConnectionInfo()` covered

* test: covering parseEngineURL() and getParams()

* chore: switching jest test files to `.inspect` to prevent conflict with aw
This commit is contained in:
Ahmad Mirzaei
2022-09-27 13:21:17 +02:00
committed by GitHub
parent 5990d85a95
commit 58e375820c
7 changed files with 525 additions and 32 deletions

View File

@@ -1,12 +1,13 @@
module.exports = {
clearMocks: true,
testEnvironment: 'jest-environment-jsdom',
testRegex: ['commands/serve/web/.+\\.(test|spec)\\.[jt]sx?$'],
testRegex: ['commands/serve/web/.+\\.(spec|test|inspect)\\.[jt]sx?$'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
collectCoverageFrom: [
'commands/serve/web/**/*.{js,jsx}',
'!commands/serve/web/**/*.spec.{js,jsx}',
'!commands/serve/web/**/*.test.{js,jsx}',
'!commands/serve/web/**/*.inspect.{js,jsx}',
'!commands/serve/web/**/__tests__/**/*',
'!**/dist/**',