Skip to content

Commit

Permalink
Fix tests related to generating blueprints using a path instead of a …
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
bertdeblock committed Dec 13, 2022
1 parent 1efaea3 commit 75b0299
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 5 additions & 3 deletions tests/acceptance/destroy-test.js
Expand Up @@ -101,9 +101,11 @@ describe('Acceptance: ember destroy', function () {
return assertDestroyAfterGenerate(commandArgs, files);
});

it('deletes files generated using blueprint paths', function () {
let commandArgs = [`${__dirname}/../../blueprints/http-proxy`, 'foo', 'bar'];
let files = ['server/proxies/foo.js'];
it('deletes files generated using blueprint paths', async function () {
await fs.outputFile('path/to/blueprints/foo/files/foo/__name__.js', "console.log('bar');\n");

let commandArgs = [path.join('path', 'to', 'blueprints', 'foo'), 'bar'];
let files = ['foo/bar.js'];

return assertDestroyAfterGenerate(commandArgs, files);
});
Expand Down
9 changes: 3 additions & 6 deletions tests/acceptance/generate-test.js
Expand Up @@ -145,13 +145,10 @@ describe('Acceptance: ember generate', function () {
});

it('allows a path to be specified to a blueprint', async function () {
await outputFile(
'blueprints/http-proxy/files/server/proxies/__name__.js',
"import Ember from 'ember';\n" + 'export default Ember.Object.extend({ foo: true });\n'
);
await generate([path.resolve(`${__dirname}/../../blueprints/http-proxy`), 'foo', 'http://localhost:5000']);
await outputFile('path/to/blueprints/foo/files/foo/__name__.js', "console.log('bar');\n");
await generate([path.join('path', 'to', 'blueprints', 'foo'), 'bar']);

expect(file('server/index.js')).to.not.contain('foo: true', 'the local blueprint is not used');
expect(file('foo/bar.js')).to.contain("console.log('bar');\n");
});

it('passes custom cli arguments to blueprint options', async function () {
Expand Down

0 comments on commit 75b0299

Please sign in to comment.