8000 Pre / post test hooks · Issue #389 · svelte-add/svelte-add · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Pre / post test hooks #389

Open
manuel3108 opened this issue Jun 13, 2024 · 2 comments
Open

Pre / post test hooks #389

manuel3108 opened this issue Jun 13, 2024 · 2 comments
Labels

Comments

@manuel3108
Copy link
Member
          Indeed, it is a hack 😅 

Pre and post test hooks would be great in these cases

edit: A pre and post test suite hook would be helpful too. Specifically for docker containers, where we can spin them up and down, in addition to seeding them with example data (rather than the other hack of having the example data be added via the loader)

Originally posted by @AdrianGonz97 in #379 (comment)

@manuel3108 manuel3108 mentioned this issue Jun 13, 2024
6 tasks
@manuel3108
Copy link
Member Author

To provide some more context:

In some cases, it's necessary to initialize some tools / data before each test runs. From time to time, we will also need to provide some global setup for an adder, before running tests at all.

Let's implement something like this:

export const tests = defineAdderTests({
    options,
    optionValues: [
        /* ... as usual */
    ],
    files: [
        /* ... as usual */
    ],
    preTestHook: () => {
        // will be run once, before starting tests for a specific adder.
        // can be used to start up docker, install global non npm tools etc.
    },
    postTestHook: () => {
        // will be run once, after finishing all tests for a specific adder.
        // shut down docker, uninstall global non npm tools etc.
    },
    tests: [
        /* ... as usual */
    ],
});

As far as I can tell right now, this introduces a new requirement. Tests for a specific adder cannot be run at the same time as tests for another adder. Let's assume we have two adders, drizzle and tauri. In that case we need to test all variations of drizzle first, and then start testing tauri. Executing them in parallel might cause side effects, so we need to avoid this.

@manuel3108 manuel3108 added the enhancement New feature or request label Jun 13, 2024
@manuel3108
Copy link
Member Author

Blocked by #461

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

No branches or pull requests

1 participant
0