Skip to content

Update project #210

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

Merged
merged 3 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/blueprints/*/files/**/*.js
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ module.exports = {
// node files
{
files: [
'ember-cli-build.js',
'index.js',
'testem.js',
'ember-cli-build.js',
'blueprints/*/index.js',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe change this to "blueprings/**/*.js"?

Then we don't need /* eslint-env node */ in the other node files inside the "blueprints/" dir.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky bit with those directories is that they're a mix of node and Emberland files. This entry is from the default addon blueprint, and our -addon-import and test-framework-detector are sort of oddballs, so it seemed simpler to leave it as-is rather than having to keep dealing with merge conflicts each time we update.

'config/**/*.js',
'tests/dummy/config/**/*.js',
'lib/**/*.js',
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
Expand Down
1 change: 1 addition & 0 deletions blueprints/-addon-import.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
'use strict';

var stringUtil = require('ember-cli-string-utils');
Expand Down
1 change: 1 addition & 0 deletions blueprints/test-framework-detector.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-env node */
'use strict';

const fs = require('fs');
Expand Down
146 changes: 71 additions & 75 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,84 +1,80 @@
module.exports = {
useYarn: true,
scenarios: [
{
name: 'integrated-node-tests',
command: 'yarn nodetest',
npm: {
devDependencies: {
'ember-cli-qunit': null,
'use strict';

const getChannelURL = require('ember-source-channel-url');

module.exports = function() {
return Promise.all([
getChannelURL('release'),
getChannelURL('beta'),
getChannelURL('canary'),
]).then(urls => {
return {
useYarn: true,
scenarios: [
{
name: 'integrated-node-tests',
command: 'yarn nodetest',
npm: {
devDependencies: {
'ember-cli-qunit': null,
},
},
},
},
},
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0',
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0',
},
},
},
},
},
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0',
{
name: 'ember-lts-2.16',
npm: {
devDependencies: {
'ember-source': '~2.16.0',
},
},
},
},
},
{
name: 'ember-release',
bower: {
dependencies: {
ember: 'components/ember#release',
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'ember-source': '~2.18.0',
},
},
},
resolutions: {
ember: 'release',
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': urls[0],
},
},
},
},
npm: {
devDependencies: {
'ember-source': null,
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': urls[1],
},
},
},
},
},
{
name: 'ember-beta',
bower: {
dependencies: {
ember: 'components/ember#beta',
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': urls[2],
},
},
},
resolutions: {
ember: 'beta',
{
name: 'ember-default',
npm: {
devDependencies: {},
},
},
},
npm: {
devDependencies: {
'ember-source': null,
},
},
},
{
name: 'ember-canary',
bower: {
dependencies: {
ember: 'components/ember#canary',
},
resolutions: {
ember: 'canary',
},
},
npm: {
devDependencies: {
'ember-source': null,
},
},
},
{
name: 'ember-default',
npm: {
devDependencies: {},
},
},
],
],
};
});
};
14 changes: 2 additions & 12 deletions node-tests/blueprints/component-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,9 @@ describe('Blueprint: component-test', function() {
});
});

describe('with usePods=true', function() {
beforeEach(function() {
fs.writeFileSync(
'.ember-cli',
`{
"disableAnalytics": false,
"usePods": true
}`
);
});

describe('with --pod', function() {
it('component-test x-foo', function() {
return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
return emberGenerateDestroy(['--pod', 'component-test', 'x-foo'], _file => {
expect(_file('tests/integration/components/x-foo/component-test.ts')).to.equal(
fixture('component-test/default.ts')
);
Expand Down
4 changes: 2 additions & 2 deletions node-tests/fixtures/acceptance-test/mocha.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, beforeEach, afterEach } from 'mocha';
import { expect } from 'chai';
import startApp from 'my-app/tests/helpers/start-app';
import destroyApp from 'my-app/tests/helpers/destroy-app';
import { run } from '@ember/runloop';

describe('Acceptance | foo', function() {
let application;
Expand All @@ -11,7 +11,7 @@ describe('Acceptance | foo', function() {
});

afterEach(function() {
destroyApp(application);
run(application, 'destroy');
});

it('can visit /foo', function() {
Expand Down
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
"homepage": "https://github.com/typed-ember/ember-cli-typescript",
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js blueprints/*/index.js addon addon-test-support app config lib server test-support tests node-tests",
"lint:js": "eslint ./*.js addon addon-test-support app blueprints config lib server test-support tests",
"start": "ember serve",
"test": "ember try:each",
"nodetest": "mocha node-tests --recursive"
"test": "ember test",
"nodetest": "mocha node-tests --recursive",
"test:all": "ember try:each"
},
"dependencies": {
"broccoli-debug": "^0.6.4",
Expand Down Expand Up @@ -66,7 +67,7 @@
"@types/node": "^9.6.5",
"@types/qunit": "^2.0.31",
"broccoli-asset-rev": "^2.6.0",
"ember-cli": "~2.18.2",
"ember-cli": "~3.1.4",
"ember-cli-app-version": "^3.1.3",
"ember-cli-babel": "^6.6.0",
"ember-cli-blueprint-test-helpers": "^0.18.3",
Expand All @@ -84,11 +85,14 @@
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.5.0",
"ember-source": "~2.18.0",
"ember-source": "~3.1.0",
"ember-source-channel-url": "^1.0.1",
"ember-try": "^0.2.23",
"eslint": "^4.17.0",
"eslint-plugin-ember": "^5.0.3",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-node": "^6.0.1",
"loader.js": "^4.2.3",
"mocha": "^5.0.0",
"testdouble": "^3.5.0",
Expand Down
17 changes: 16 additions & 1 deletion tests/dummy/config/targets.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
'use strict';

const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
];

const isCI = !!process.env.CI;
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}

module.exports = {
browsers: ['ie 9', 'last 1 Chrome versions', 'last 1 Firefox versions', 'last 1 Safari versions'],
browsers
};
Empty file added tests/helpers/.gitkeep
Empty file.
5 changes: 0 additions & 5 deletions tests/helpers/destroy-app.js

This file was deleted.

21 changes: 0 additions & 21 deletions tests/helpers/module-for-acceptance.js

This file was deleted.

17 changes: 0 additions & 17 deletions tests/helpers/start-app.js

This file was deleted.

31 changes: 16 additions & 15 deletions tests/integration/components/js-importing-ts-test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { moduleForComponent, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('js-importing-ts', 'Integration | Component | js importing ts', {
integration: true,
});
module('Integration | Component | js importing ts', function(hooks) {
setupRenderingTest(hooks);

test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{js-importing-ts}}`);
await render(hbs`{{js-importing-ts}}`);

assert.equal(
this.$()
.text()
.replace(/\s+/g, ' ')
.trim(),
'js-importing-ts.hbs false Ts helper: my type of help Js helper: js please help me'
);
assert.equal(
this.element.textContent
.replace(/\s+/g, ' ')
.trim(),
'js-importing-ts.hbs false Ts helper: my type of help Js helper: js please help me'
);
});
});
Loading