# Snapshot report for `src/e2e/generate.e2e.js`

The actual snapshot is saved in `generate.e2e.js.snap`.

Generated by [AVA](https://ava.li).

## md-seed generate --help

> Snapshot 1

    `␊
    Generate Seeder␊
    ␊
      Generate new seeder file into the seeder folder. ␊
    ␊
    Synopsis␊
    ␊
      $ md-seed generate seeder-name ␊
      $ md-seed g seeder-name        ␊
      $ md-seed g --help             ␊
    ␊
    Options␊
    ␊
      -n, --name name   Seeder name to generate ␊
      -h, --help        Show usage guide        ␊
    `

## md-seed generate some-seeder

> log results

    [
      [
        'CREATED seeders/some-name.seeder.js',
      ],
    ]

> sandbox content

    [
      {
        content: [
          {
            content: `import { Seeder } from 'mongoose-data-seed';␊
            import { Model } from '../server/models';␊
            ␊
            const data = [{␊
            ␊
            }];␊
            ␊
            class SomeNameSeeder extends Seeder {␊
            ␊
              async shouldRun() {␊
                return Model.countDocuments().exec().then(count => count === 0);␊
              }␊
            ␊
              async run() {␊
                return Model.create(data);␊
              }␊
            }␊
            ␊
            export default SomeNameSeeder;␊
            `,
            name: 'some-name.seeder.js',
          },
        ],
        name: 'seeders',
      },
    ]

## md-seed generate some-seeder (fail without md-seed-config.js)

> Snapshot 1

    'Must contain md-seed-config.js at the project root. run `md-seed init` to create the config file.'

## md-seed generate some-seeder with custom template and seeders folder

> log results

    [
      [
        'CREATED my-custom-seeders-folder/some-name.seeder.js',
      ],
    ]

> sandbox content

    [
      {
        content: `<% const message = `I am ${seederName} and I created by a custom seeder template.`; %>␊
        console.log('<%= message %>');␊
        `,
        name: 'custom-seeder-template.ejs',
      },
      {
        content: [
          {
            content: `␊
            console.log('I am SomeName and I created by a custom seeder template.');␊
            `,
            name: 'some-name.seeder.js',
          },
        ],
        name: 'my-custom-seeders-folder',
      },
    ]
