Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] New API #315

Closed
silkentrance opened this issue Oct 28, 2022 · 1 comment
Closed

[FEATURE] New API #315

silkentrance opened this issue Oct 28, 2022 · 1 comment

Comments

@silkentrance
Copy link
Member

silkentrance commented Oct 28, 2022

See https://github.com/testdeck/testdeck/tree/315-revamp-api for the actual code.

New Public API

I would like to propose a new API for @testdeck. See also the PR #316

Note that this issue is a successor of #314.

  • all support for the done callback has been dropped, so it is either Promises or sync
  • the new API no longer mimics the describe, it from the underlying testing framework
    one has to either import these or use the available globals
  • all decorators have been streamlined so that they always require a call expression, e.g. @After() vs @After
  • one can now have multiple @Before() and @After() hooks, both static and instance
  • the instance of the test suite will be created once only and not before each test as was the case before.
  • @Params(...) no longer replaces @Test(...)
  • one can have multiple @Params(...) on a test method
  • the condition for skip, pending, only on suite and test can now be either a boolean or a function that returns a boolean
  • Only was renamed to Focus as it communicates the purpose more clearly

The new public API will be like this

@Suite(options?: SuiteOptions)
@Suite.Skip(options?: ConditionalSuiteOptions)
@Suite.Pending(options?: ConditionalSuiteOptions)
@Suite.Focus(options?: ConditionalSuiteOptions)

@Test(options?: TestOptions)
@Test.Skip(options?: ConditionalTestOptions)
@Test.Pending(options?: ConditionalTestOptions)
@Test.Focus(options?: ConditionalTestOptions)

@Params(params: unknown, options?: ParamsOptions)

@Before(options?: HookOptions)
@After(options?: HookOptions)

interface ExecutionOptions {
  timeout?: number;
  retry?: number;
  slow?: number;
}

interface SuiteOptions extends ExecutionOptions {
}

interface ConditionalSuiteOptions extends ExecutionOptions {
  condition?: boolean | (() => boolean);
}

interface TestOptions extends ExecutionOptions {
  name?: string;
}

interface ConditionalTestOptions extends TestOptions {
  condition?: boolean | (() => boolean);
}

interface ParamsOptions {
  name: string | ((params: unknown) => string);
}

interface HookOptions extends ExecutionOptions {
}

Internals

  • The existing code was rewritten and made more simple
    The code should now be much easier to understand so that others might want
    to chime in and contribute to the project as well
  • We are now using ESLINT. Existing code was made type safe and all linter errors have been resolved
  • Test coverage gets collected and reported
  • extraneous index.d.ts have been removed in favor of automatically generated ones
  • jasmine tests now use the jasmine assertions framework as chai will not work with jasmine
  • core tests have been rewritten, following the general structure of the old tests,
    "intercepting" on decorator creation and so on, providing us with more information so that
    we can assert upon internal features as well, e.g. which kind of symbols have been set and so on
  • this allows us to do more focused testing in individual test suites and to increase overall test coverage
  • test coverage for @testdeck/jasmine is at 100% (timeout still needs some tests)
  • test coverage for @testdeck/jest is at 100% (timeout still needs some tests)
  • test coverage for @testdeck/vitest is at 100% (timeout, retry still needs some tests)
  • test coverage for @testdeck/mocha is at 100%
  • test coverage for @testdeck/di-typedi is at 100%
  • test coverage for @testdeck/core is not at a 100% but only a few lines and branches have not been tested, yet
This was referenced Oct 28, 2022
@silkentrance silkentrance linked a pull request Oct 28, 2022 that will close this issue
12 tasks
@silkentrance silkentrance self-assigned this Oct 28, 2022
@silkentrance silkentrance added enhancement breaking Breaking feature or feature request labels Oct 28, 2022
silkentrance added a commit that referenced this issue Oct 28, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
silkentrance added a commit that referenced this issue Oct 28, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
@silkentrance silkentrance mentioned this issue Oct 28, 2022
2 tasks
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Oct 30, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 1, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 2, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 7, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 10, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 10, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 10, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 10, 2022
- major rewrite
- switch to eslint
- enable test coverage
- increase test coverage
- reverting back to latest devDependencies
- pushing down devDependencies from root into the respective packages so that errors show up early
- remove node 17.x from workflow
- add node 18.x and 19.x to workflow
- run tests on all platforms: ubuntu, windows, macos
silkentrance added a commit that referenced this issue Nov 22, 2022
- major rewrite
@silkentrance silkentrance changed the title [FEATURE] Revamp Existing API [FEATURE] New API Nov 22, 2022
silkentrance added a commit that referenced this issue Nov 22, 2022
- major rewrite
silkentrance added a commit that referenced this issue Nov 22, 2022
- major rewrite
silkentrance added a commit that referenced this issue Nov 22, 2022
- major rewrite
@silkentrance silkentrance pinned this issue Dec 3, 2022
silkentrance added a commit that referenced this issue Dec 3, 2022
- major rewrite
@silkentrance silkentrance unpinned this issue Dec 3, 2022
@silkentrance silkentrance added this to the v1.0.0 milestone Dec 5, 2022
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 7, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 8, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 8, 2022
- major rewrite
silkentrance added a commit that referenced this issue Dec 8, 2022
- major rewrite
@silkentrance
Copy link
Member Author

closing as this project does not get enough attention

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

Successfully merging a pull request may close this issue.

1 participant