sirap-group / generate-swap-generator

Generate Your Own ESNext+StandardJS+Mocha Ready NodeJS Generators In Seconds!
https://sirap-group.github.io/generate-swap-generator
MIT License
2 stars 0 forks source link

Unit tests fails for fresh generated generator #61

Closed rbecheras closed 6 years ago

rbecheras commented 6 years ago
$ yarn mocha dist/tests/**/*.js
$ /tmp/testing/generate-generator-example/node_modules/.bin/mocha 'dist/tests/**/*.js'

  testing
    tasks
      1) should extend tasks onto the instance
      ✓ should run the `default` task with .build (167ms)
      ✓ should run the `default` task with .generate
    generator-example (CLI)
      2) should run the default task using the `testing` name (global install)
      3) should run the default task using the `generator-example` generator alias (local generator.js)
    generator-example (API)
      ✓ should run the default task on the generator
Cannot find task: "project" in generator: "generator-example"
      4) should run the `generator-example` task
      ✓ should run the `default` task when defined explicitly
    sub-generator
      ✓ should work as a sub-generator
      ✓ should run the `default` task by default
      ✓ should run the `generator:default` task when defined explicitly
Cannot find task: "project" in generator: "foo.generator-example"
      5) should run the `generator:project` task when defined explicitly
      ✓ should work with nested sub-generators
Cannot find task: "package" in generator: "sub0.sub1"
      6) should run tasks as a sub-generator

  testing
    plugin
      ✓ should add tasks to the instance
      ✓ should only register the plugin once

  10 passing (4s)
  6 failing

  1) testing
       tasks
         should extend tasks onto the instance:
     AssertionError: expected { Object (check-directory, main, ...) } to have property 'project'
      at Context.<anonymous> (dist/tests/generator.test.js:72:29)

  2) testing
       generator-example (CLI)
         should run the default task using the `testing` name (global install):
     Error: Cannot find generator: "testing"
      at Generate.<anonymous> (node_modules/base-generators/index.js:499:18)
      at iterate (node_modules/async-each-series/index.js:8:5)
      at Function.module.exports (node_modules/async-each-series/index.js:20:3)
      at Generate.generate (node_modules/base-generators/index.js:492:15)
      at Generate.generate (node_modules/base-generators/index.js:463:23)
      at Context.<anonymous> (dist/tests/generator.test.js:89:11)

  3) testing
       generator-example (CLI)
         should run the default task using the `generator-example` generator alias (local generator.js):
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

  4) testing
       generator-example (API)
         should run the `generator-example` task:
     Error: ENOENT: no such file or directory, stat '/tmp/testing/generate-generator-example/dist/tests/actual/example.txt'

  5) testing
       sub-generator
         should run the `generator:project` task when defined explicitly:
     Error: ENOENT: no such file or directory, stat '/tmp/testing/generate-generator-example/dist/tests/actual/example.txt'

  6) testing
       sub-generator
         should run tasks as a sub-generator:
     Error: ENOENT: no such file or directory, stat '/tmp/testing/generate-generator-example/dist/tests/actual/example.txt'

error Command failed with exit code 6.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.