Skip to content

[refactor] tests #1983

Description

@alexander-akait

No issue template. Ref: #1982 (comment)

Test structure (approximately):

- test
  - e2e
  - cli
  - client
    - clients
      - SockJSClient.test.js 
    - utils
      - sendMessage.test.js
    - overlay.test.js 
  - server
    - servers
      - SockJSServer.test.js
    - utils
      - tryParseInt.test.js

Test naming:

  1. class tests have same name as class -> MyClass.js -> MyClass.test.js
  2. pure file like defaultPort.js -> defaultPort.test.js
  3. options for server should be placed in server directory and have name compress-option.test.js
  4. options for client should be placed in client directory and have name sockPath-options.test.js

Next we should improve test performance, many tests are very long and written in effective way.

Some of tests files should be merge in other, some of separated based on above structure.

I am WIP on this after merge this PR


Ideally each option should have:

  1. Unit test (own)
  2. Integration test (Server.test.js)
  3. E2E test (can be avoided for non client options)
  4. CLI test (can be avoided right now)

We should concentrate on 1 and 2 points right now.

Other changes what we should do:

  • avoid using --runInBand it is decrease time on tests
  • union option.test.js and validation.test.js (they do same)
  • rewrite some test in more effective way
  • better naming of tests

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions