Skip to content

Commit

Permalink
wip more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Sep 18, 2020
1 parent 204b6ea commit 74b29f1
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
13 changes: 13 additions & 0 deletions packages/ember-cli-fastboot/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ module.exports = {
env: {
embertest: true
}
},

// mocha test files
{
files: ['test/**/*.js'],
env: {
node: true,
mocha: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
};
2 changes: 1 addition & 1 deletion packages/ember-cli-fastboot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"broccoli-plugin": "^1.3.1",
"chalk": "^2.4.1",
"ember-cli-babel": "^7.1.0",
"ember-cli-blueprint-test-helpers": "^0.19.2",
"ember-cli-blueprint-test-helpers": "mansona/ember-cli-blueprint-test-helpers#fix-ember-generate-options",
"ember-cli-lodash-subset": "2.0.1",
"ember-cli-preprocess-registry": "^3.1.2",
"ember-cli-version-checker": "^3.0.0",
Expand Down
33 changes: 27 additions & 6 deletions packages/ember-cli-fastboot/test/default-blueprint-test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
'use strict';

const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;

const { emberGenerate, emberNew, setupTestHooks } = blueprintHelpers;

const MockUI = require('console-ui/mock');

const expect = require('ember-cli-blueprint-test-helpers/chai').expect;

describe('Acceptance: ember generate and destroy default-blueprint', function() {
describe.only('Acceptance: ember generate and destroy default-blueprint', function() {
setupTestHooks(this);

it('default-blueprint foo', async function() {
let args = ['ember-cli-fastboot'];

// process.stdout.on('data', function(data) {
// console.log('face', data.toString());
// process.stdin.writeLine('y');
// // process.stdout.write(data);
// });



// pass any additional command line options in the arguments array
await emberNew();

const file = await emberGenerateDestroy(args);
// let ui = new MockUI();

// let interval = setInterval(() => {
// ui.inputStream.write('y\n\r');
// }, 2000);

const ember = await emberGenerate(args);

setTimeout(() => {
ember.inputStream.write('y\n');
}, 4000)

// clearInterval(interval);

expect(file('config/targets.js')).to.contain(`node: 'current'`);
// expect(file('config/targets.js')).to.contain(`node: 'current'`);
});
});

0 comments on commit 74b29f1

Please sign in to comment.