Nitroglycerin Pickle Machine
    Wondering what’s next for npm?Check out our public roadmap! »

    @seagull/seed
    TypeScript icon, indicating that this package has built-in type declarations

    18.2.6 • Public • Published

    seed (fixtures)

    Library implementing seed data generation for test cases.

    Seed data generation

    Use global switch to enable seed data generation:

    import { config } from '@seagull/seed'
    
    config.seed = true
    ...
    // do your thing
    ...
    config.seed = false

    The seed data can be fetched in any mode except pure, as tests within the code pipeline should not call external ressources.

    Configuration hooks

    In case you want to modify the seed creation for a specific case, you can create a specific SeedLocalConfig by creating a TypeScript-file within the seed folder structure:

    import { LocalConfig } from '@seagull/seed'
    
    export default <LocalConfig<SomeResponse>>{
      hook: (fixture: SomeResponse) => {
        // do something, e.g. slice some arrays within the fixture
        return fixture
      },
      expiresInDays: 14, // fixture will be re-fetched after 14 days
    }

    A configuration file is applied for all subsequent fixtures.

    Install

    npm i @seagull/seed

    DownloadsWeekly Downloads

    142

    Version

    18.2.6

    License

    LGPL-3.0

    Unpacked Size

    44.3 kB

    Total Files

    41

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar