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

Add tests for FastBoot usage #96

Merged
merged 1 commit into from
Apr 3, 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
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- 6
- 8

sudo: false
dist: trusty
Expand All @@ -28,6 +26,7 @@ env:
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default
- EMBER_TRY_SCENARIO=fastboot-addon-tests

matrix:
fast_finish: true
Expand Down
4 changes: 4 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ module.exports = function() {
npm: {
devDependencies: {}
}
},
{
name: 'fastboot-addon-tests',
command: 'ember fastboot:test'
}
]
};
Expand Down
12 changes: 12 additions & 0 deletions fastboot-tests/fixtures/fastboot/app/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
location: config.locationType,
rootURL: config.rootURL
});

Router.map(function() {
});

export default Router;
9 changes: 9 additions & 0 deletions fastboot-tests/fixtures/fastboot/app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{#step-manager as |w|}}
{{#w.step}}
<h1>First Step</h1>
{{/w.step}}

{{#w.step}}
<h1>Second Step</h1>
{{/w.step}}
{{/step-manager}}
22 changes: 22 additions & 0 deletions fastboot-tests/index-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-env node, mocha */

'use strict';

const expect = require('chai').expect;
const setupTest = require('ember-fastboot-addon-tests').setupTest;

describe('FastBoot', function() {
setupTest('fastboot');

it('renders the initially visible step', async function() {
const res = await this.visit('/');
const { jQuery: jq, response } = res;

expect(response.statusCode).to.equal(200);
expect(
jq('h1')
.text()
.trim()
).to.equal('First Step');
});
});
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"devDependencies": {
"@ember/test-helpers": "^0.7.18",
"broccoli-asset-rev": "^2.5.0",
"chai": "^4.1.2",
"ember-cli": "~3.0.0",
"ember-cli-addon-docs": "^0.3.0",
"ember-cli-addon-docs-yuidoc": "^0.1.0",
Expand All @@ -34,6 +35,7 @@
"ember-cli-deploy-git-ci": "^1.0.1",
"ember-cli-document-title": "^0.3.3",
"ember-cli-eslint": "^4.2.3",
"ember-cli-fastboot": "^1.1.4-beta.1",
"ember-cli-inject-live-reload": "^1.7.0",
"ember-cli-qunit": "^4.3.2",
"ember-cli-shims": "^1.2.0",
Expand All @@ -46,6 +48,7 @@
"ember-css-modules": "^0.7.10",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.0",
"ember-fastboot-addon-tests": "^0.4.0",
"ember-hook": "^1.4.2",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
Expand Down
Loading