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 ember-try testing for ember-cli-fastboot #858

Merged
merged 3 commits into from
Oct 19, 2021
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
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,33 @@ jobs:
- name: Run Mocha Tests
run: |
yarn workspace ember-cli-fastboot test:mocha

try-scenarios:
name: "ember-try for ember-cli-fastboot: ${{ matrix.ember-try-scenario }}"
runs-on: ubuntu-latest
timeout-minutes: 7

strategy:
fail-fast: false
matrix:
ember-try-scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-release
- ember-beta
- ember-canary
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized
- no-deprecations
- ember-release-no-deprecations

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: yarn install --ignore-engines --frozen-lockfile
- name: test
run: yarn workspace ember-cli-fastboot ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
99 changes: 99 additions & 0 deletions packages/ember-cli-fastboot/config/ember-try.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.16',
npm: {
devDependencies: {
'ember-source': '~3.16.0',
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.5',
},
},
},
{
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release'),
},
},
},
{
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta'),
},
},
},
{
name: 'ember-canary',
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary'),
},
},
},
{
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true,
}),
},
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0',
},
},
},
{
name: 'ember-classic',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false,
}),
},
npm: {
ember: {
edition: 'classic',
},
},
},
embroiderSafe(),
embroiderOptimized(),
{
name: 'no-deprecations',
npm: {
devDependencies: {
'ember-deprecation-error': '*',
},
},
},
{
name: 'ember-release-no-deprecations',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release'),
'ember-deprecation-error': '*',
},
},
},
],
};
};
5 changes: 4 additions & 1 deletion packages/ember-cli-fastboot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"test": "npm-run-all lint test:*",
"test:mocha": "node fix-node-modules.mjs && mocha && node fix-node-modules.mjs -r",
"test:ember": "ember test",
"test:precook": "node node_modules/ember-cli-addon-tests/scripts/precook-node-modules.js"
"test:precook": "node node_modules/ember-cli-addon-tests/scripts/precook-node-modules.js",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"broccoli-concat": "^3.7.1",
Expand Down Expand Up @@ -78,7 +79,9 @@
"ember-resolver": "^8.0.2",
"ember-sinon": "^2.2.0",
"ember-source": "~3.26.1",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.2.0",
"ember-try": "^1.4.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-ember": "^10.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{{outlet}}

<div class="shoebox">
{{model.key1.foo}}
{{model.key2.zip}}
{{this.model.key1.foo}}
{{this.model.key2.zip}}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module('Instance-initializer: clear-double-boot', function(hooks) {
`);

// render the whole tree dynamically to more closely mimc bad markup cases
await render(hbs`{{{BAD_HTML}}}`);
await render(hbs`{{{this.BAD_HTML}}}`);

clearHtml();
assert.notOk(this.element.querySelector('#fastboot-body-start'), 'There is no start marker');
Expand All @@ -41,7 +41,7 @@ module('Instance-initializer: clear-double-boot', function(hooks) {
this.set('BAD_HTML', `<script type="x/boundary" id="fastboot-body-start"></script>`);

// render the whole tree dynamically to more closely mimc bad markup cases
await render(hbs`{{{BAD_HTML}}}`);
await render(hbs`{{{this.BAD_HTML}}}`);

clearHtml();

Expand Down