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

BlueprintAcceptanceTest fails with 'file already exists' #60

Open
knownasilya opened this issue Apr 18, 2018 · 1 comment
Open

BlueprintAcceptanceTest fails with 'file already exists' #60

knownasilya opened this issue Apr 18, 2018 · 1 comment

Comments

@knownasilya
Copy link
Member

My code:

import * as path from 'path';
import * as fs from 'fs';
import test from 'ava';
import {
  BlueprintAcceptanceTest
} from '@denali-js/cli';

test('test outputed files', async (t) => {
  let defaultBlueprint = new BlueprintAcceptanceTest('default');
  await defaultBlueprint.run();
  let builtFile = path.join(defaultBlueprint.dir, 'dist', 'app', 'namespaces', 'application.js');
  let results = fs.readFileSync(builtFile, 'utf-8');

  t.log(results);
  t.true(results);
});

The output:

$ DEBUG=@denali* denali test -- --verbose
cli v0.1.4 [local]  @denali-js/cli:bootstrap discovering commands from addons +0ms
  @denali-js/cli:find-addons searching for addons locally in /Users/iradchenko/sandbox/denali-sockets +0ms
  @denali-js/cli:find-addons found 2 addons:
  @denali-js/cli:find-addons   - @denali-js/core [/Users/iradchenko/sandbox/denali-sockets/node_modules/@denali-js/core]
  @denali-js/cli:find-addons   - @denali-js/typescript [/Users/iradchenko/sandbox/denali-sockets/node_modules/@denali-js/typescript]
  @denali-js/cli:find-addons  +26ms
  @denali-js/cli:bootstrap found 10 commands from @denali-js/core: [ build, console, destroy, generate, install, migrate, publish, routes, server, test ]  +638ms
 | denali v0.1.2 [local]
  @denali-js/cli:bootstrap found 0 commands from @denali-js/typescript: [  ]  +1ms
  @denali-js/cli:command adding command: build +0ms
  @denali-js/cli:command adding command: console +1ms
  @denali-js/cli:command adding command: destroy <blueprint> +1ms
  @denali-js/cli:command adding command: generate <blueprint> +0ms
  @denali-js/cli:command adding command: install <addonName> +0ms
  @denali-js/cli:command adding command: migrate +0ms
  @denali-js/cli:command adding command: publish +0ms
  @denali-js/cli:command adding command: routes +1ms
  @denali-js/cli:command adding command: server +0ms
  @denali-js/cli:command adding command: test [files...] +0ms
  @denali-js/cli:command adding command: addon <name> +0ms
  @denali-js/cli:command adding command: new <name> +0ms
  @denali-js/cli:command building options for 'test' command +29ms
  @denali-js/cli:command invoking 'test' command +7ms
  @denali-js/cli:project creating project for /Users/iradchenko/sandbox/denali-sockets +0ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/test/dummy +0ms
  @denali-js/cli:builder using local builder +643ms
  @denali-js/cli:builder:dummy created builder for dummy@0.0.0 +0ms
  @denali-js/cli:builder:dummy searching for child addons in /Users/iradchenko/sandbox/denali-sockets/test/dummy +1ms
  @denali-js/cli:builder:dummy discovered child addon: @denali-js/core +12ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/test/dummy/node_modules/@denali-js/core +0ms
  @denali-js/cli:builder using local builder +593ms
  @denali-js/cli:builder:dummy>@denali-js/core created builder for @denali-js/core@0.1.2 +0ms
  @denali-js/cli:builder:dummy discovered child addon: @denali-js/eslint +612ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/test/dummy/node_modules/@denali-js/eslint +18ms
  @denali-js/cli:builder using local builder +49ms
  @denali-js/cli:builder:dummy>@denali-js/eslint created builder for @denali-js/eslint@0.1.1 +0ms
  @denali-js/cli:builder:dummy discovered child addon: @denali-js/babel +51ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/test/dummy/node_modules/@denali-js/babel +2ms
  @denali-js/cli:builder using local builder +252ms
  @denali-js/cli:builder:dummy>@denali-js/babel created builder for @denali-js/babel@0.1.1+0ms
  @denali-js/cli:builder:dummy discovered child addon: denali-sockets +253ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets +1ms
  @denali-js/cli:builder using local builder +0ms
  @denali-js/cli:builder:dummy>denali-sockets created builder for denali-sockets@0.0.1 +0ms
  @denali-js/cli:builder:dummy creating base tree from: app/,config/,lib/,blueprints/,commands/,config/,guides/,test/ +1ms
  @denali-js/cli:builder:dummy compiling +3ms
  @denali-js/cli:builder:dummy running hooks +0ms
  @denali-js/cli:builder:dummy running processParent hook from @denali-js/eslint +0ms
  @denali-js/cli:builder:dummy running processParent hook from @denali-js/babel +95ms
  @denali-js/cli:builder:dummy including @denali-js/core fragment in app bundle +229ms
  @denali-js/cli:builder:dummy>@denali-js/core is root builder: false; is developing: false; is addon under test: false; is symlinked: false; is not compiled: false +634ms
  @denali-js/cli:builder:dummy>@denali-js/core no build needed, using precompiled +0ms
  @denali-js/cli:builder:dummy including @denali-js/eslint fragment in app bundle +1ms
  @denali-js/cli:builder:dummy>@denali-js/eslint is root builder: false; is developing: false; is addon under test: false; is symlinked: false; is not compiled: false +583ms
  @denali-js/cli:builder:dummy>@denali-js/eslint no build needed, using precompiled +0ms
  @denali-js/cli:builder:dummy including @denali-js/babel fragment in app bundle +1ms
  @denali-js/cli:builder:dummy>@denali-js/babel is root builder: false; is developing: false; is addon under test: false; is symlinked: false; is not compiled: false +330ms
  @denali-js/cli:builder:dummy>@denali-js/babel no build needed, using precompiled +0ms
  @denali-js/cli:builder:dummy including denali-sockets fragment in app bundle +1ms
  @denali-js/cli:builder:dummy>denali-sockets is root builder: false; is developing: false; is addon under test: true; is symlinked: false; is not compiled: true +330ms
  @denali-js/cli:builder:dummy>denali-sockets not precompiled - building now +0ms
  @denali-js/cli:builder:dummy>denali-sockets searching for child addons in /Users/iradchenko/sandbox/denali-sockets +0ms
  @denali-js/cli:builder:dummy>denali-sockets discovered child addon: @denali-js/core +5ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/node_modules/@denali-js/core +0ms
  @denali-js/cli:builder using local builder +1ms
  @denali-js/cli:builder:dummy>denali-sockets>@denali-js/core created builder for @denali-js/core@0.1.2 +0ms
  @denali-js/cli:builder:dummy>denali-sockets discovered child addon: @denali-js/typescript +2ms
  @denali-js/cli:builder creating builder for /Users/iradchenko/sandbox/denali-sockets/node_modules/@denali-js/typescript +1ms
  @denali-js/cli:builder using local builder +284ms
  @denali-js/cli:builder:dummy>denali-sockets>@denali-js/typescript created builder for @denali-js/typescript@0.1.1 +0ms
  @denali-js/cli:builder:dummy>denali-sockets creating base tree from: app/,config/,lib/,blueprints/,commands/,config/,guides/,test/ +293ms
  @denali-js/cli:builder:dummy>denali-sockets compiling +10ms
  @denali-js/cli:builder:dummy>denali-sockets running hooks +0ms
  @denali-js/cli:builder:dummy>denali-sockets running processParent hook from @denali-js/typescript +0ms
  @denali-js/cli:builder:dummy>denali-sockets including unit tests in output +8ms
  @denali-js/cli:builder:dummy including unit tests in output +324ms
  @denali-js/cli:project building project +2s
  @denali-js/cli:project copying broccoli build output to dist +8s
  @denali-js/cli:project project build finished +34ms
✔ denali-sockets build complete (8.259s)
===> Running denali-sockets tests ...
  @denali-js/core:test:command-acceptance populating tmp/command-acceptance-test--22839yyR8
Z4aqjShD with dummy app +0ms

  6 passed
  1 failed

  acceptance › default-blueprint-test › test outputed files

  /Users/iradchenko/sandbox/denali-sockets/node_modules/@denali-js/cli/lib/test/command-acceptance.ts:136

  Rejected promise returned by test. Reason:

  Error {
    code: 'EEXIST',
    errno: -17,
    path: 'tmp/command-acceptance-test--22839yyR8Z4aqjShD/node_modules',
    syscall: 'mkdir',
    message: 'EEXIST: file already exists, mkdir \'tmp/command-acceptance-test--22839yyR8Z4aqjShD/node_modules\'',
  }

  BlueprintAcceptanceTest.populateWithDummy (node_modules/@denali-js/cli/lib/test/command-acceptance.ts:136:8)
  new CommandAcceptanceTest (node_modules/@denali-js/cli/lib/test/command-acceptance.ts:117:12)
  new BlueprintAcceptanceTest (node_modules/@denali-js/cli/lib/test/blueprint-acceptance.ts:17:5)
  Test.__dirname [as fn] (tmp/-dummy/test/acceptance/default-blueprint-test.js:9:26)

===> Tests failed 💥
@knownasilya
Copy link
Member Author

Looks like https://github.com/denali-js/cli/blob/master/lib/test/command-acceptance.ts#L106 needs to be modified for the extended BlueprintAcceptanceTest class.

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

No branches or pull requests

1 participant