diff --git a/.eslintignore b/.eslintignore
index 2003cec41a0..d619eb5c112 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,5 +1,10 @@
blueprints/*/*files/**/*.js
+blueprints-js/*/*files/**/*.js
+blueprints/*/*files/**/*.ts
node-tests/fixtures/**/*.js
/docs/
dist/
tmp/
+smoke-tests/
+types/
+type-tests/
diff --git a/.eslintrc.js b/.eslintrc.js
index ac34ace5fd1..a30b8021976 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -2,78 +2,72 @@ const path = require('path');
module.exports = {
root: true,
- parser: 'babel-eslint',
+ parser: '@typescript-eslint/parser',
+ reportUnusedDisableDirectives: true,
extends: [
'eslint:recommended',
- 'prettier',
'plugin:import/errors',
+ 'plugin:import/typescript',
'plugin:qunit/recommended',
+ 'plugin:prettier/recommended',
],
- plugins: [
- 'ember-internal',
- 'prettier',
- 'import',
- 'qunit',
- 'disable-features',
- ],
+ plugins: ['ember-internal', 'import', 'qunit', 'disable-features'],
rules: {
+ 'no-console': 'error',
'no-implicit-coercion': 'error',
'no-new-wrappers': 'error',
'no-unused-vars': 'error',
'no-throw-literal': 'error',
'no-var': 'error',
- 'prettier/prettier': 'error',
+
+ 'qunit/no-assert-equal': 'off',
'qunit/no-commented-tests': 'off',
'qunit/require-expect': 'off',
+
'disable-features/disable-async-await': 'error',
'disable-features/disable-generator-functions': 'error',
},
settings: {
- 'import/core-modules': [
- 'require',
- 'backburner',
- 'router',
- 'ember/version',
- 'node-module',
- ],
- 'import/parsers': {
- '@typescript-eslint/parser': ['.ts'],
- },
+ 'import/core-modules': ['require', 'backburner', 'router', '@glimmer/interfaces'],
'import/resolver': {
node: {
- extensions: [ '.js', '.ts' ],
- paths: [
- path.resolve('./packages/'),
- ]
- }
- }
+ extensions: ['.js', '.ts', '.d.ts'],
+ paths: [path.resolve('./packages/')],
+ },
+ },
},
overrides: [
{
- files: [ '**/*.ts' ],
+ files: ['*.ts'],
- parser: '@typescript-eslint/parser',
+ extends: ['plugin:@typescript-eslint/recommended'],
parserOptions: {
sourceType: 'module',
+ project: './tsconfig.json',
+ tsconfigRootDir: __dirname,
},
rules: {
- // the TypeScript compiler already takes care of this and
- // leaving it enabled results in false positives for interface imports
- 'no-dupe-class-members': 'off',
- 'no-unused-vars': 'off',
- 'no-undef': 'off',
-
- 'import/export': 'off',
- 'import/named': 'off',
- 'import/no-unresolved': 'off',
- }
+ '@typescript-eslint/ban-ts-comment': 'warn',
+ '@typescript-eslint/ban-types': 'off',
+ '@typescript-eslint/no-empty-function': 'off',
+ '@typescript-eslint/no-this-alias': 'off',
+ '@typescript-eslint/no-var-requires': 'warn',
+ '@typescript-eslint/consistent-type-imports': 'error',
+
+ // TODO: Enable and fix these rules
+ // Typescript provides better types with these rules enabled
+ 'prefer-spread': 'off',
+ 'prefer-const': 'off',
+ 'prefer-rest-params': 'off',
+ },
},
{
- files: [ 'packages/**/*.js' ],
+ // TODO: files: ['packages/**/*.[jt]s'],
+ files: ['packages/**/*.js'],
parserOptions: {
ecmaVersion: 2017,
@@ -82,17 +76,18 @@ module.exports = {
globals: {
// A safe subset of 'browser:true':
- 'window': true,
- 'document': true,
- 'setTimeout': true,
- 'clearTimeout': true,
- 'setInterval': true,
- 'clearInterval': true,
- 'console': true,
- 'Map': true,
- 'Set': true,
- 'Symbol': true,
- 'WeakMap': true,
+ window: true,
+ document: true,
+ setTimeout: true,
+ clearTimeout: true,
+ setInterval: true,
+ clearInterval: true,
+ console: true,
+ Map: true,
+ Set: true,
+ Symbol: true,
+ WeakMap: true,
+ Event: true,
},
rules: {
@@ -111,33 +106,35 @@ module.exports = {
qunit: true,
},
globals: {
- 'expectAssertion': true,
- 'expectDeprecation': true,
- 'expectDeprecationAsync': true,
- 'expectNoDeprecation': true,
- 'expectWarning': true,
- 'expectNoWarning': true,
- 'ignoreAssertion': true,
- 'ignoreDeprecation': true,
+ expectAssertion: true,
+ expectDeprecation: true,
+ expectDeprecationAsync: true,
+ expectNoDeprecation: true,
+ expectWarning: true,
+ expectNoWarning: true,
+ ignoreAssertion: true,
+ ignoreDeprecation: true,
},
rules: {
'disable-features/disable-async-await': 'off',
'disable-features/disable-generator-functions': 'off',
- }
+ },
},
{
// matches all node-land files
files: [
+ '.eslintrc.js',
'node-tests/**/*.js',
'tests/node/**/*.js',
'blueprints/**/*.js',
+ 'blueprints-js/**/*.js',
'bin/**/*.js',
'tests/docs/*.js',
'config/**/*.js',
'lib/**/*.js',
'server/**/*.js',
'testem.js',
- 'testem.travis-browsers.js',
+ 'testem.ci-browsers.js',
'testem.browserstack.js',
'd8-runner.js',
'broccoli/**/*.js',
@@ -156,44 +153,28 @@ module.exports = {
},
plugins: ['node'],
- rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
+ extends: ['plugin:node/recommended'],
+ rules: {
// add your custom rules and overrides for node files here
'no-process-exit': 'off',
'no-throw-literal': 'error',
'disable-features/disable-async-await': 'off',
'disable-features/disable-generator-functions': 'off',
- }),
- },
- {
- // matches node-land files that aren't shipped to consumers (allows using Node 6+ features)
- files: [
- 'broccoli/**/*.js',
- 'tests/node/**/*.js',
- 'ember-cli-build.js',
- 'rollup.config.js',
- 'd8-runner.js',
- ],
-
- rules: {
- 'node/no-unsupported-features': ['error', { version: 6 }],
- }
+ },
},
{
- files: [ 'node-tests/**/*.js' ],
+ files: ['node-tests/**/*.js'],
env: {
mocha: true,
},
},
{
- files: [
- 'tests/docs/**/*.js',
- 'tests/node/**/*.js',
- ],
+ files: ['tests/docs/**/*.js', 'tests/node/**/*.js'],
env: {
- qunit: true
+ qunit: true,
},
},
- ]
+ ],
};
diff --git a/.gitattributes b/.gitattributes
index 09bc62c1393..9e09e498870 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
-* text=auto
\ No newline at end of file
+* text=auto
+
+# Tell GH to render all tsconfigs in the tsconfig dir correctly.
+tsconfig/*.json linguist-language=JSON-with-Comments
diff --git a/.github/ISSUE_TEMPLATE/4-other.md b/.github/ISSUE_TEMPLATE/4-other.md
index f6ee379febb..7f9131c19f2 100644
--- a/.github/ISSUE_TEMPLATE/4-other.md
+++ b/.github/ISSUE_TEMPLATE/4-other.md
@@ -1,6 +1,6 @@
---
name: Other
-about: Report an issue that does not fit any of the categoroes above.
+about: Report an issue that does not fit any of the categories above.
title: ''
labels: ''
assignees: ''
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000000..4aa0ece9968
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,23 @@
+version: 2
+updates:
+- package-ecosystem: npm
+ directory: "/"
+ schedule:
+ interval: monthly
+ open-pull-requests-limit: 10
+ versioning-strategy: increase
+ ignore:
+ - dependency-name: github
+ versions:
+ - "> 0.2.4"
+ - dependency-name: ember-cli
+ versions:
+ - 3.25.0
+ - dependency-name: broccoli-rollup
+ versions:
+ - 4.1.1
+- package-ecosystem: github-actions
+ directory: "/"
+ schedule:
+ interval: weekly
+ open-pull-requests-limit: 10
diff --git a/.github/workflows/alpha-releases.yml b/.github/workflows/alpha-releases.yml
new file mode 100644
index 00000000000..ec8c33043db
--- /dev/null
+++ b/.github/workflows/alpha-releases.yml
@@ -0,0 +1,64 @@
+name: Alpha Releases
+
+on:
+ schedule:
+ - cron: '0 20 * * 3' # weekly (Wednesday)
+
+jobs:
+ test:
+ name: Basic Test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ run: yarn ember build
+ - name: test
+ env:
+ TEST_SUITE: each-package
+ run: yarn test
+
+ release:
+ name: Tag + Release
+ runs-on: ubuntu-latest
+ needs: [test]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ registry-url: 'https://registry.npmjs.org'
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: setup git
+ run: |
+ git config --local user.email 'tomster@emberjs.com'
+ git config --local user.name 'Ember.js Alpha Releaser'
+ - name: Find next alpha
+ run: |
+ LATEST_ALPHA=`npm view ember-source dist-tags.alpha`
+ export NEXT_ALPHA=`node bin/next-alpha-version.js ${LATEST_ALPHA}`
+ echo "NEXT_ALPHA=$NEXT_ALPHA" >> $GITHUB_ENV
+ - name: tag the next alpha
+ run: npm version ${{env.NEXT_ALPHA}} --allow-same-version
+ - name: build for publish
+ env:
+ BUILD_TYPE: alpha
+ OVERRIDE_FEATURES: ''
+ run: node bin/build-for-publishing.js
+ - name: publish to npm
+ run: npm publish
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
+ - name: push tag
+ # Push in a way that will NOT trigger other workflows
+ run: git push origin v${{env.NEXT_ALPHA}}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000000..5d8468db559
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,394 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - master
+ - beta
+ - release
+ # release branches
+ - release*
+ - lts*
+ # nightly ci cron branches
+ - cron*
+ tags:
+ - 'v*'
+ paths-ignore:
+ - 'CHANGELOG.md'
+ pull_request:
+
+jobs:
+ lint:
+ name: Linting
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: linting
+ run: yarn lint
+
+ types:
+ name: Type Checking (current version)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: Check published types
+ run: yarn type-check:types
+
+ types-range:
+ name: Type Checking (other supported versions)
+ runs-on: ubuntu-latest
+ needs: ['types']
+ strategy:
+ matrix:
+ ts-version: ['next']
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build stable type definitions
+ run: yarn build:types
+ - name: install TS@${{matrix.ts-version}}
+ run: yarn add -D typescript@${{ matrix.ts-version }}
+ - name: Check published types with TS@${{matrix.ts-version}}
+ run: yarn type-check:types
+
+ basic-test:
+ name: Debug and Prebuilt (All Tests by Package + Canary Features)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ run: yarn ember build
+ - name: Upload build
+ uses: actions/upload-artifact@v3
+ with:
+ name: dist
+ path: dist
+ - name: test
+ env:
+ TEST_SUITE: each-package
+ run: yarn test
+
+ browserstack-test:
+ name: Browserstack Tests (Safari, Edge)
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ SHOULD_TRANSPILE: true
+ run: yarn ember build
+ - name: test:browserstack
+ env:
+ BROWSERSTACK_USERNAME: emberjscoreteam1
+ # This is in plaintext on purpose. It has no privileged access to anything (this is a free
+ # account) and it allows us to run browserstack tests against PRs.
+ BROWSERSTACK_ACCESS_KEY: o5LNEdygq1SP4L9kst4s
+ run: yarn test:browserstack
+
+ smoke-test:
+ name: Smoke tests (Full Ember Apps)
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ run: yarn ember build -prod
+ - name: test
+ # todo: potentially more apps? use matrix?
+ run: |
+ yarn link
+ cd smoke-tests/ember-test-app/
+ yarn
+ yarn link ember-source
+ yarn test
+
+ production-test:
+ name: Production (All Tests + Canary Features)
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ run: yarn ember build -prod
+ - name: test
+ run: yarn test
+
+ production-debug-render-test:
+ name: Production (All Tests + Canary Features with Debug Render Tree)
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ DEBUG_RENDER_TREE: true
+ run: yarn ember build -prod
+ - name: test
+ run: yarn test
+
+ extend-prototypes-test:
+ name: Extend Prototypes
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - uses: actions/download-artifact@v3
+ with:
+ name: dist
+ path: dist
+ - name: test
+ env:
+ TEST_SUITE: extend-prototypes
+ run: yarn test
+
+ node-test:
+ name: Node.js Tests
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build
+ env:
+ DISABLE_SOURCE_MAPS: true
+ BROCCOLI_ENV: production
+ SHOULD_TRANSPILE_FOR_NODE: true
+ run: yarn ember build -prod
+ - name: test
+ run: yarn test:node
+
+ blueprint-test:
+ name: Blueprint Tests
+ runs-on: ubuntu-latest
+ needs: [lint]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: test
+ run: yarn test:blueprints
+
+ browser-test:
+ name: Browser Tests (Firefox)
+ runs-on: ubuntu-latest
+ needs: [basic-test, lint, types]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - uses: actions/download-artifact@v3
+ with:
+ name: dist
+ path: dist
+ - name: Setup firefox
+ uses: browser-actions/setup-firefox@latest
+ with:
+ firefox-version: 91.0.1
+ - run: firefox --version
+ - name: test
+ run: yarn ember test -c testem.ci-browsers.js
+
+ deploy-tag:
+ name: Deploy tags to npm
+ runs-on: ubuntu-latest
+ needs:
+ [
+ basic-test,
+ lint,
+ browserstack-test,
+ production-test,
+ production-debug-render-test,
+ extend-prototypes-test,
+ node-test,
+ blueprint-test,
+ browser-test,
+ ]
+ if: startsWith(github.ref, 'refs/tags/v')
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ registry-url: 'https://registry.npmjs.org'
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build for publish
+ run: node bin/build-for-publishing.js
+ - name: publish to npm
+ run: npm publish
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
+
+ publish:
+ name: Publish channel to s3
+ runs-on: ubuntu-latest
+ needs:
+ [
+ basic-test,
+ lint,
+ browserstack-test,
+ production-test,
+ production-debug-render-test,
+ extend-prototypes-test,
+ node-test,
+ blueprint-test,
+ browser-test,
+ ]
+ # Only run on pushes to branches that are not from the cron workflow
+ if: github.event_name == 'push' && contains(github.ref, 'cron') != true
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build for publish
+ run: node bin/build-for-publishing.js
+ - name: publish to s3
+ run: node bin/publish_to_s3.js
+ env:
+ S3_BUCKET_NAME: 'builds.emberjs.com'
+ S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}}
+ S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID}}
+
+ publish-alpha:
+ name: Publish alpha from default branch
+ runs-on: ubuntu-latest
+ needs:
+ [
+ basic-test,
+ lint,
+ browserstack-test,
+ production-test,
+ production-debug-render-test,
+ extend-prototypes-test,
+ node-test,
+ blueprint-test,
+ browser-test,
+ ]
+ # Only run on pushes to master
+ if: github.event_name == 'push' && github.ref == 'refs/heads/master'
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 14.x
+ cache: yarn
+ - name: install dependencies
+ run: yarn install --frozen-lockfile --non-interactive
+ - name: build for publish
+ run: node bin/build-for-publishing.js
+ - name: publish to s3
+ run: node bin/publish_to_s3.js
+ env:
+ BUILD_TYPE: alpha
+ OVERRIDE_FEATURES: ''
+ S3_BUCKET_NAME: 'builds.emberjs.com'
+ S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}}
+ S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID}}
+
+ notify:
+ name: Notify Discord
+ runs-on: ubuntu-latest
+ needs:
+ [
+ basic-test,
+ lint,
+ browserstack-test,
+ production-test,
+ production-debug-render-test,
+ extend-prototypes-test,
+ node-test,
+ blueprint-test,
+ browser-test,
+ ]
+ if: failure() && contains(github.ref, 'cron') == true
+ steps:
+ - uses: sarisia/actions-status-discord@v1
+ with:
+ webhook: ${{ secrets.FRAMEWORK_WEBHOOK }}
+ status: "Failure"
+ title: "Ember.js Nightly CI"
+ color: 0xcc0000
+ url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+ username: GitHub Actions
diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml
new file mode 100644
index 00000000000..a6cd7eb04a3
--- /dev/null
+++ b/.github/workflows/cron.yml
@@ -0,0 +1,57 @@
+name: Cron
+
+on:
+ schedule:
+ - cron: '0 7 * * *' # daily, 7am
+ workflow_dispatch:
+
+jobs:
+ trigger-ci:
+ name: Trigger cron build
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ branch:
+ - master
+ - beta
+ - release
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ fetch-depth: 0
+ ref: ${{matrix.branch}}
+
+ - name: Make a commit to have a unique sha
+ run: |
+ touch cron.txt
+ git config --local user.email 'cron@example.com'
+ git config --local user.name 'Ember.js Cron CI'
+ git add cron.txt
+ git commit -m "Cron $(date +%Y-%m-%d) for ${{matrix.branch}}"
+ export SHA=`git rev-parse HEAD`
+ echo "SHA=$SHA" >> $GITHUB_ENV
+
+ - name: Push branch to trigger Build workflow
+ # This must use a personal access token because of a Github Actions
+ # limitation where it will not trigger workflows from pushes from
+ # other workflows with the token it provides.
+ # The PERSONAL_ACCESS secret must be a token with `repo` scope.
+ # See https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
+ run: |
+ git checkout -B cron-${{matrix.branch}}-${{env.SHA}}
+ git push https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_TOKEN }}@github.com/${GITHUB_REPOSITORY} cron-${{matrix.branch}}-${{env.SHA}} --force
+
+ - name: Wait for Build completion
+ uses: jitterbit/await-check-suites@v1
+ with:
+ ref: ${{ env.SHA }}
+ appSlugFilter: github-actions
+ onlyFirstCheckSuite: true
+ timeoutSeconds: 1800
+
+ - name: Cleanup
+ # Always cleanup the cron-* branches
+ if: always()
+ run: git push https://${GITHUB_ACTOR}:${{ secrets.PERSONAL_TOKEN}}@github.com/${GITHUB_REPOSITORY} --delete cron-${{matrix.branch}}-${{env.SHA}} || true # Don't fail build if cleanup fails
diff --git a/.github/workflows/night-ts.yml b/.github/workflows/night-ts.yml
new file mode 100644
index 00000000000..3dfecdca87c
--- /dev/null
+++ b/.github/workflows/night-ts.yml
@@ -0,0 +1,32 @@
+name: Nightly TypeScript Run
+
+jobs:
+ ts-next:
+ name: typescript@next
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: volta-cli/action@v4
+ - run: yarn install --frozen-lockfile --non-interactive
+ - run: yarn add -D typescript@next
+ - run: yarn type-check
+ notify:
+ name: Notify Discord
+ runs-on: ubuntu-latest
+ needs: [ ts-next ]
+ if: failure()
+ steps:
+ - uses: sarisia/actions-status-discord@v1
+ with:
+ webhook: ${{ secrets.TYPESCRIPT_WEBHOOK }}
+ status: "Failure"
+ title: "Ember.js Nightly TypeScript Run"
+ color: 0xcc0000
+ url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+ username: GitHub Actions
+
+# ...nightly at midnight
+on:
+ schedule:
+ - cron: 0 0 * * *
+ workflow_dispatch:
diff --git a/.gitignore b/.gitignore
index c03f4f312bd..0f018875cdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,4 +45,11 @@ npm-debug.log
*.tgz
*.tar.gz
*.log
+/.vscode
+# These are automatically generated by our build process.
+# TODO: make that *fully* true: The root types/stable directory is *not*
+# automatically generated yet, and accordingly we have explicitly committed a
+# couple of the files. Once it is, we can switch this over to just ignoring
+# `types/stable` entirely.
+types/stable
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index ac96d17ad5e..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-branches:
- only:
- - master
- - beta
- - release
- # release branches
- - /^(?:release|lts)-\d+-\d+$/
- # npm version tags
- - /^v\d+\.\d+\.\d+/
-
-language: node_js
-node_js:
- - "10"
-
-addons:
- firefox: "latest"
-
-env:
- global:
- - BROWSERSTACK_USERNAME=emberjscoreteam1
- - BROWSERSTACK_ACCESS_KEY=YsPxXKcahx9XszyHS2Gr
- - DISABLE_SOURCE_MAPS=true
- - BROCCOLI_ENV=production
- - S3_BUCKET_NAME=builds.emberjs.com
- - secure: "SHnuJ4A3QbSc3LV2fYynDPbbSbhVl0ZWnCiKPuRgwnddDnoSaMQUY2RqyHdtsQGdUZCOeNaMvYUhYx6hzxBVHn0yuN3KA20aSwvYdwaMgZXfJi+lyxgsEI8iYdksWXvVbCAyKM8zjTWXUtNcMBGtsGYOfdD41wfZgI8GsI0YYJc="
- - secure: ! 'KXJmcGLpnxnPmmei/qPNVcdQxLX1xyYIaVocinQ0YAjtBvCtAwg63EWMFnGp
-
- VIzUNikE+Cej3g+nwEdDJiL1c9NFPL+zCnriR2iMVjPak+IQaG3YcMm0T+hY
- /WLEPAquZBKw1gU6lBEUuDumTlkXQQdHz3cJYoidAXz3uV1EXIU='
- - secure: ! 'qCW0BVNFuQjAI53pvvE6oeGxtEdZ+RlvcCpYjU4vxEjedidEEcHKtIVh7d7J
-
- PZ8DNTxX0zsp2jjY8NwTR5MC8NBH+J5VjuTSGv82t5sm0i0jzaBmOOSLbKqH
-
- I/BFT0MbnR6JVCZiPV7TCWPgY1gvgZ6TEEIKGqauDMUBdL8ZK6I='
- - secure: e0yxVfwVW61d3Mi/QBOsY6Rfd1mZd3VXUd9xNRoz/fkvQJRuVwDe7oG3NOuJ4LZzvMw7BJ+zpDV9D8nKhAyPEEOgpkkMHUB7Ds83pHG4qSMzm4EAwBCadDLXCQirldz8dzN5FAqgGucXoj5fj/p2SKOkO6qWIZveGr8pdBJEG1E=
-
-cache:
- yarn: true
-
-stages:
- - basic tests
- - additional tests
- - name: deploy
- if: type IN (push)
-
-before_install:
- - curl -o- -L https://yarnpkg.com/install.sh | bash
- - export PATH=$HOME/.yarn/bin:$PATH
-
- # install the most recent `npm version`
- # used when publishing to build a properly packed tarball
- - npm i -g npm
-
-install:
- - yarn install --frozen-lockfile --non-interactive
-
-jobs:
- include:
- - stage: Basic Tests
- name: Debug and Prebuilt (All Tests by Package + Canary Features + Optional Jquery)
- env: TEST_SUITE=each-package
- script:
- - yarn ember build
- - yarn test
-
- - name: Linting
- script:
- - yarn lint
-
- - stage: Additional Tests
- name: Browserstack Tests (Safari, Edge, IE11)
- env: SHOULD_TRANSPILE=true
- script:
- - yarn ember build
- - yarn test:browserstack
-
- - name: Production (All Tests + Canary Features)
- script:
- - yarn ember build -prod
- - yarn test
-
- - name: Production (All Tests + Canary Features + Debug Render Tree)
- env: DEBUG_RENDER_TREE=true
- script:
- - yarn ember build -prod
- - yarn test
-
- - name: Old Jquery and Extend Prototypes
- env: TEST_SUITE=old-jquery-and-extend-prototypes
- script:
- - yarn ember build
- - yarn test
-
- - name: Node.js Tests
- script:
- - yarn ember build -prod
- - yarn test:node
-
- - name: Blueprint Tests
- script:
- - yarn test:blueprints
-
- - name: Browser Tests (Firefox)
- script:
- - yarn ember build
- - yarn ember test -c testem.travis-browsers.js
-
- - stage: deploy
- env:
- - PUBLISH=true
- script:
- - "./bin/publish_builds"
-
- - if: branch = master
- env:
- - BUILD_TYPE=alpha
- - OVERRIDE_FEATURES=EMBER_METAL_TRACKED_PROPERTIES
- - PUBLISH=true
- script:
- - "./bin/publish_builds"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b2b830f141..509ef7759ab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,13 +1,579 @@
# Ember Changelog
-### v3.19.0 (May 26, 2020)
+## v4.12.3 (June 30, 2023)
+
+- [#20493](https://github.com/emberjs/ember.js/pull/20493) [BUGFIX LTS] Backport more types fixes
+
+## v4.12.2 (June 28, 2023)
+
+- [#20481](https://github.com/emberjs/ember.js/pull/20481) [BUGFIX LTS] Backport some stable type import locations
+
+## v4.12.1 (June 12, 2023)
+
+- [#20461](https://github.com/emberjs/ember.js/pull/20461) [BUGFIX] Fix cyclic module crash with engines and fastboot.
+
+## v4.12.0 (April 3, 2023)
+
+- [#20352](https://github.com/emberjs/ember.js/pull/20352) [FEATURE] Enable generating Typescript blueprints when `isTypeScriptProject` is true without additional environment variables per [RFC #800](https://rfcs.emberjs.com/id/0800-ts-adoption-plan).
+- [#20355](https://github.com/emberjs/ember.js/pull/20355) [FEATURE] Enhance the Typescript blueprint for generated services per [RFC #800](https://rfcs.emberjs.com/id/0800-ts-adoption-plan).
+- [#20356](https://github.com/emberjs/ember.js/pull/20356) [FEATURE] Generate signature in Typescript component blueprints per [RFC #800](https://rfcs.emberjs.com/id/0800-ts-adoption-plan).
+- [#20388](https://github.com/emberjs/ember.js/pull/20388) [BUGFIX] Don't run getters while applying mixins
+- [#20398](https://github.com/emberjs/ember.js/pull/20398) [BUGFIX] Fix runloop types on TS 5.0+
+- [#20385](https://github.com/emberjs/ember.js/pull/20385) [BUGFIX] Improve error for owner methods called after destroy
+
+## v4.11.0 (February 20, 2023)
+
+- [#20288](https://github.com/emberjs/ember.js/pull/20288) [FEATURE] Stable types for `@ember/owner`
+- [#20323](https://github.com/emberjs/ember.js/pull/20323) [FEATURE] Introduce stable types for `@ember/error`
+- [#20361](https://github.com/emberjs/ember.js/pull/20361) [BUGFIX] Support a `router.ts` file when generating routes
+- [#20373](https://github.com/emberjs/ember.js/pull/20373) / [#20374](https://github.com/emberjs/ember.js/pull/20374) [BUGFIX] Make the type for `SafeString` public
+- [#20345](https://github.com/emberjs/ember.js/pull/20345) [CLEANUP] Remove flags for released features
+- [#20285](https://github.com/emberjs/ember.js/pull/20285) Update to TS v4.9
+
+## v4.10.0 (January 11, 2023)
+
+- [#20270](https://github.com/emberjs/ember.js/pull/20270) / [#20271](https://github.com/emberjs/ember.js/pull/20271) [FEATURE] Add new imports for `getOwner` and `setOwner` from `@ember/owner` and introduce new `@ember/routing` sub-modules as part of [RFC #821](https://rfcs.emberjs.com/id/0821-public-types).
+- [#20341](https://github.com/emberjs/ember.js/pull/20341) [DEPRECATION] Deprecations for importing `htmlSafe` and `isHTMLSafe` from `@ember/string`. They have moved to `@ember/template`. From [RFC #236](https://rfcs.emberjs.com/id/0236-deprecation-ember-string).
+- [#20344](https://github.com/emberjs/ember.js/pull/20344) [DEPRECATION] Deprecate @ember/string when used from ember-source; point users to add the `@ember/string` addon per [RFC #236](https://rfcs.emberjs.com/id/0236-deprecation-ember-string).
+- [#20342](https://github.com/emberjs/ember.js/pull/20342) [DEPRECATION] Deprecate @ember/error per [RFC #889](https://rfcs.emberjs.com/id/0889-deprecate-ember-error).
+- [#20327](https://github.com/emberjs/ember.js/pull/20327) [BUGFIX] Fix the types for the mutation-methods of `NativeArray`
+- [#20283](https://github.com/emberjs/ember.js/pull/20283) [BUGFIX] revert TS `compilerOptions.target` to ES2017
+- [#20253](https://github.com/emberjs/ember.js/pull/20253) Types: Add the `Resolver` type to preview types
+- [#20319](https://github.com/emberjs/ember.js/pull/20319) Types: resolve services with `Owner.lookup`
+
+## v4.9.3 (December 13, 2022)
+
+- [#20321](https://github.com/emberjs/ember.js/pull/20321) [BUGFIX] ContainerDebugAdapter extends EmberObject
+
+## v4.8.4 (December 13, 2022)
+
+- [#20321](https://github.com/emberjs/ember.js/pull/20321) [BUGFIX] ContainerDebugAdapter extends EmberObject
+
+## v4.9.2 (December 12, 2022)
+
+- [#20296](https://github.com/emberjs/ember.js/pull/20296) Controller `queryParams` should support `readonly` arrays
+- [#20318](https://github.com/emberjs/ember.js/pull/20318) Backport `Resolver` to preview types
+
+## v4.8.3 (December 12, 2022)
+
+- [#20296](https://github.com/emberjs/ember.js/pull/20296) Controller `queryParams` should support `readonly` arrays
+- [#20318](https://github.com/emberjs/ember.js/pull/20318) Backport `Resolver` to preview types
+
+## v4.9.1 (November 30, 2022)
+
+- [#20284](https://github.com/emberjs/ember.js/pull/20284) [BUGFIX] remove incorrect types for deprecation functions
+
+## v3.28.11 (November 30, 2022)
+
+- [#20286](https://github.com/emberjs/ember.js/pull/20286) [BUGFIX] Allow class-based helpers in strict-mode
+
+## v4.9.0 (November 28, 2022)
+
+- [#20274](https://github.com/emberjs/ember.js/pull/20274) [BUGFIX] Add some missing types to preview types
+- [#20256](https://github.com/emberjs/ember.js/pull/20256) [BUGFIX] Correct types for Ember Arrays
+- [#20257](https://github.com/emberjs/ember.js/pull/20257) [BUGFIX] Fix types for `getOwner` and GlimmerComponent
+- [#20233](https://github.com/emberjs/ember.js/pull/20233) [BUGFIX] Include package name in deprecation error message
+- [#20235](https://github.com/emberjs/ember.js/pull/20235) [BUGFIX] Update `@types/node` for TS 4.9 issue
+- [#20238](https://github.com/emberjs/ember.js/pull/20238) [BUGFIX] Update Node.js versions to match support policy
+- [#20227](https://github.com/emberjs/ember.js/pull/20227) [BUGFIX] Fix unsafe internal cast for NativeArray
+- [#20228](https://github.com/emberjs/ember.js/pull/20228) [BUGFIX] Remove type export for ControllerMixin
+- [#20203](https://github.com/emberjs/ember.js/pull/20203) / [#20204](https://github.com/emberjs/ember.js/pull/20204) [FEATURE] Preview types: Update to Typescript 4.8
+
+## v4.8.2 (November 3, 2022)
+
+- [#20244](https://github.com/emberjs/ember.js/pull/20244) Add missing type for `getComponentTemplate` to preview types
+
+## v4.8.1 (November 2, 2022)
+
+- [CVE pending](https://emberjs.com/blog/ember-4-8-1-released) Fix a prototype pollution vulnerability in `set` and `setProperties`
+
+## v4.4.4 (November 2, 2022)
+
+- [CVE pending](https://emberjs.com/blog/ember-4-8-1-released) Fix a prototype pollution vulnerability in `set` and `setProperties
+
+## v3.28.10 (November 2, 2022)
+
+- [CVE pending](https://emberjs.com/blog/ember-4-8-1-released) Fix a prototype pollution vulnerability in `set` and `setProperties`
+
+## v3.24.7 (November 2, 2022)
+
+- [CVE pending](https://emberjs.com/blog/ember-4-8-1-released) Fix a prototype pollution vulnerability in `set` and `setProperties`
+
+## v4.8.0 (October 17, 2022)
+
+- [#20180](https://github.com/emberjs/ember.js/pull/20180) [FEATURE] Publish an opt-in preview of public types for Ember
+- [#20166](https://github.com/emberjs/ember.js/pull/20166) [BUGFIX] Upgrade router_js to fix Linked list of RouteInfos contains undefined object
+
+## v4.4.3 (October 12, 2022)
+
+- [#20166](https://github.com/emberjs/ember.js/pull/20166) [BUGFIX] Fix missing `RouteInfo` entries
+
+## v4.7.1 (October 12, 2022)
+
+- [#20166](https://github.com/emberjs/ember.js/pull/20166) [BUGFIX] Fix missing `RouteInfo` entries
+
+## v4.7.0 (September 6, 2022)
+
+- [#20126](https://github.com/emberjs/ember.js/pull/20126) [BUGFIX] Replace Firefox detection that used a deprecated browser API
+
+## v4.6.0 (July 25, 2022)
+
+- [#20125](https://github.com/emberjs/ember.js/pull/20125) [BUGFIX] Replace deprecated substr() method with substring() method.
+
+## v4.5.1 (July 25, 2022)
+
+- [#20120](https://github.com/emberjs/ember.js/pull/20120) [BUGFIX] Adjust uniqueId() implementation to only generate valid selectors.
+
+## v4.5.0 (June 13, 2022)
+
+- [#20052](https://github.com/emberjs/ember.js/pull/20052) / [#20055](https://github.com/emberjs/ember.js/pull/20055) [FEATURE] Add the default helper manager to implement [RFC #0756](https://github.com/emberjs/rfcs/blob/master/text/0756-helper-default-manager.md).
+- [#20053](https://github.com/emberjs/ember.js/pull/20053) [FEATURE] Expose `renderSettled` from `@ember/renderer` to enable implementation of [RFC #0785](https://github.com/emberjs/rfcs/blob/master/text/0785-remove-set-get-in-tests.md).
+
+## v4.4.2 (June 13, 2022)
+
+- [#20114](https://github.com/emberjs/ember.js/pull/20114) [BUGFIX] Fix generated import paths for test setup functions in addons
+
+## v4.4.1 (May 31, 2022)
+
+- [#20082](https://github.com/emberjs/ember.js/pull/20082) [BUGFIX] Fix blueprints publication
+
+## v4.4.0 (May 2, 2022)
+
+- [#19882](https://github.com/emberjs/ember.js/pull/19882) / [#20005](https://github.com/emberjs/ember.js/pull/20005) [FEATURE] Implement the `unique-id` helper per [RFC #0659](https://github.com/emberjs/rfcs/blob/master/text/0659-unique-id-helper.md).
+- [#19981](https://github.com/emberjs/ember.js/pull/19981) [FEATURE] Facilitate custom test setups per [RFC #0637](https://github.com/emberjs/rfcs/blob/master/text/0637-customizable-test-setups.md).
+- [#16879](https://github.com/emberjs/ember.js/pull/16879) [BUGFIX] isEmpty on nested objects
+- [#17978](https://github.com/emberjs/ember.js/pull/17978) Make hasListeners public
+- [#20014](https://github.com/emberjs/ember.js/pull/20014) Log `until` for deprecations
+
+## v3.28.9 (April 19, 2022)
+
+- [#20028](https://github.com/emberjs/ember.js/pull/20028) Fix a memory leak in the Router Service class
+
+## v4.3.0 (March 21, 2022)
+
+- [#20025](https://github.com/emberjs/ember.js/pull/20025) [BUGFIX] Fix a memory leak in the Router Service class
+- [#19971](https://github.com/emberjs/ember.js/pull/19971) [BUGFIX] Don't serialize default Query Params on RouterService
+- [#20024](https://github.com/emberjs/ember.js/pull/20024) [BUGFIX] Correctly associate props with factory and owner in FactoryManager
+
+## v4.2.0 (February 7, 2022)
+
+- [#19878](https://github.com/emberjs/ember.js/pull/19878) [BUGFIX] Allow class-based helpers to work in strict-mode.
+
+## v4.1.0 (December 28, 2021)
+
+- [#19772](https://github.com/emberjs/ember.js/pull/19772) / [#19826](https://github.com/emberjs/ember.js/pull/19826) [FEATURE] Add a `@cached` decorator per [RFC #0566](https://github.com/emberjs/rfcs/blob/af64915b5ecde010fce09309a47ee6d2447588d0/text/0566-memo-decorator.md).
+- [#19471](https://github.com/emberjs/ember.js/pull/19471) / [#19834](https://github.com/emberjs/ember.js/pull/19834) [FEATURE] Add `refresh` method to the Router Service per [RFC #0631](https://github.com/emberjs/rfcs/blob/master/text/0631-refresh-method-for-router-service.md).
+- [#19776](https://github.com/emberjs/ember.js/pull/19776) [FEATURE] Provide `service` export from `@ember/service` in favour of `inject` implementing [RFC #0752](https://github.com/emberjs/rfcs/blob/master/text/0752-inject-service.md).
+- [#19510](https://github.com/emberjs/ember.js/pull/19510) [DEPRECATION] Deprecate auto location per [RFC #0711](https://github.com/emberjs/rfcs/blob/master/text/0711-deprecate-auto-location.md).
+- [#17570](https://github.com/emberjs/ember.js/pull/17570) [BUGFIX] Passing ObjectProxy with a property size to `isEmpty` would throw assertion
+- [#18269](https://github.com/emberjs/ember.js/pull/18269) [BUGFIX] Fix for when query params are using a nested value
+
+## v4.0.1 (December 1, 2021)
+
+- [#19858](https://github.com/emberjs/ember.js/pull/19858) [BUGFIX] Improve assert message in default store for when routes have dynamic segments but no model hook
+- [#19860](https://github.com/emberjs/ember.js/pull/19860) [BUGFIX] Add model hook in route blueprint for routes with dynamic segments
+
+## v4.0.0 (November 15, 2021)
+
+- [#19761](https://github.com/emberjs/ember.js/pull/19761) [BREAKING] Require ember-auto-import >= 2 or higher to enable ember-source to become a v2 addon in the 4.x cycle
+- [#19706](https://github.com/emberjs/ember.js/pull/19706) [BREAKING] Explicitly drop Node 10 support to match support policy.
+- [BREAKING] Remove deprecated features
+ - [#19838](https://github.com/emberjs/ember.js/pull/19838) [CLEANUP] Remove check to see if `ember` is defined as a Bower dependency
+ - [#19846](https://github.com/emberjs/ember.js/pull/19846) [CLEANUP] Make using the "classic" edition of Ember throw
+ - [#19833](https://github.com/emberjs/ember.js/pull/19833) [CLEANUP] Remove deprecated array observers
+ - [#19836](https://github.com/emberjs/ember.js/pull/19836) [CLEANUP] Turn `template-only-glimmer-components` deprecation into an error
+ - [#19843](https://github.com/emberjs/ember.js/pull/19843) [CLEANUP] Turn `argument-less-helper-paren-less-invocation` deprecation into an error
+ - [#19749](https://github.com/emberjs/ember.js/pull/19749) [CLEANUP] Remove `deprecate-router-events` support code
+ - [#19762](https://github.com/emberjs/ember.js/pull/19762) [CLEANUP] Update GlimmerVM to 0.81
+ - removes deprecation of mutations during helper compute
+ - removes deprecation of mutations during unknownProperty
+ - `@glimmer/integration-tests`, `@glimmer/manager`, `@glimmer/validator`
+ * [#1330](https://github.com/glimmerjs/glimmer-vm/pull/1330) Remove deprecated support for mutation after consumption during certain manager hooks ([@snewcomer](https://github.com/snewcomer))
+ - `@glimmer/manager`
+ * [#1328](https://github.com/glimmerjs/glimmer-vm/pull/1328) Remove deprecated Component Manager version 3.4 ([@nlfurniss](https://github.com/nlfurniss))
+ - `@glimmer/integration-tests`, `@glimmer/manager`
+ * [#1329](https://github.com/glimmerjs/glimmer-vm/pull/1329) Remove deprecated Modifier Manager version 3.13 ([@nlfurniss](https://github.com/nlfurniss))
+ - [#19806](https://github.com/emberjs/ember.js/pull/19806) [CLEANUP] Drop export of built-ins, remove legacy components
+ - [#19808](https://github.com/emberjs/ember.js/pull/19808) [CLEANUP] Remove the `--test-type` option from the helper blueprint
+ - [#19677](https://github.com/emberjs/ember.js/pull/19677) [CLEANUP] Remove jQuery from build
+ - [#19708](https://github.com/emberjs/ember.js/pull/19708) [CLEANUP] Remove class-binding-and-class-name-bindings-in-templates
+ - [#19650](https://github.com/emberjs/ember.js/pull/19650) [CLEANUP] Remove deprecated mouse events
+ - [#19675](https://github.com/emberjs/ember.js/pull/19675) [CLEANUP] Remove jQuery usage from ember-testing
+ - [#19704](https://github.com/emberjs/ember.js/pull/19704) [CLEANUP] Remove template-compiler.registerPlugin
+ - [#19707](https://github.com/emberjs/ember.js/pull/19707) [CLEANUP] Remove Application Controller Router Properties
+ - [#19528](https://github.com/emberjs/ember.js/pull/19528) [CLEANUP] Remove Logger
+ - [#19558](https://github.com/emberjs/ember.js/pull/19558) [CLEANUP] Remove IE11 support
+ - [#19563](https://github.com/emberjs/ember.js/pull/19563) [CLEANUP] Remove internal Ember.assign usage
+ - [#19636](https://github.com/emberjs/ember.js/pull/19636) [CLEANUP] Remove copy & Copyable
+ - [#19638](https://github.com/emberjs/ember.js/pull/19638) [CLEANUP] Remove deprecated with
+ - [#19639](https://github.com/emberjs/ember.js/pull/19639) [CLEANUP] Removes deprecated Private INVOKE API
+ - [#19640](https://github.com/emberjs/ember.js/pull/19640) [CLEANUP] Remove old deprecations import path
+ - [#19641](https://github.com/emberjs/ember.js/pull/19641) [CLEANUP] Remove isVisible
+ - [#19642](https://github.com/emberjs/ember.js/pull/19642) [CLEANUP] Remove aliasMethod
+ - [#19643](https://github.com/emberjs/ember.js/pull/19643) [CLEANUP] Remove deprecate without for and since
+ - [#19644](https://github.com/emberjs/ember.js/pull/19644) [CLEANUP] Remove -in-element
+ - [#19645](https://github.com/emberjs/ember.js/pull/19645) [CLEANUP] Remove tryInvoke
+ - [#19646](https://github.com/emberjs/ember.js/pull/19646) [CLEANUP] Remove loc
+ - [#19647](https://github.com/emberjs/ember.js/pull/19647) [CLEANUP] Remove Ember.merge
+ - [#19648](https://github.com/emberjs/ember.js/pull/19648) [CLEANUP] Remove getWithDefault
+ - [#19651](https://github.com/emberjs/ember.js/pull/19651) [CLEANUP] Remove LEGACY_OWNER
+ - [#19652](https://github.com/emberjs/ember.js/pull/19652) [CLEANUP] Remove Globals Resolver
+ - [#19653](https://github.com/emberjs/ember.js/pull/19653) [CLEANUP] Remove run and computed dot access
+ - [#19654](https://github.com/emberjs/ember.js/pull/19654) [CLEANUP] Remove @ember/string methods from native prototype
+ - [#19655](https://github.com/emberjs/ember.js/pull/19655) [CLEANUP] Remove meta-destruction-apis
+ - [#19656](https://github.com/emberjs/ember.js/pull/19656) [CLEANUP] Remove string-based setComponentManager
+ - [#19657](https://github.com/emberjs/ember.js/pull/19657) [CLEANUP] Remove hasBlock and hasBlockParams
+ - [#19658](https://github.com/emberjs/ember.js/pull/19658) [CLEANUP] Remove sendAction and string action passing
+ - [#19659](https://github.com/emberjs/ember.js/pull/19659) [CLEANUP] Remove renderTemplate, disconnectOutlet, render
+ - [#19660](https://github.com/emberjs/ember.js/pull/19660) [CLEANUP] Remove attrs/attrs-arg-access
+ - [#19661](https://github.com/emberjs/ember.js/pull/19661) [CLEANUP] Remove EMBER_EXTEND_PROTOTYPES
+ - [#19663](https://github.com/emberjs/ember.js/pull/19663) [CLEANUP] Remove function prototype extensions
+ - [#19665](https://github.com/emberjs/ember.js/pull/19665) [CLEANUP] Remove deprecated jQuery integration
+ - [#19666](https://github.com/emberjs/ember.js/pull/19666) [CLEANUP] Remove jQuery integration in EventDispatcher
+ - [#19667](https://github.com/emberjs/ember.js/pull/19667) [CLEANUP] Cleanup IE11 leftovers
+ - [#19670](https://github.com/emberjs/ember.js/pull/19670) [CLEANUP] Remove .volatile()
+ - [#19671](https://github.com/emberjs/ember.js/pull/19671) [CLEANUP] Remove .property()
+ - [#19673](https://github.com/emberjs/ember.js/pull/19673) [CLEANUP] Remove computed deep each
+ - [#19674](https://github.com/emberjs/ember.js/pull/19674) [CLEANUP] Remove ability to override computed property
+ - [#19678](https://github.com/emberjs/ember.js/pull/19678) [CLEANUP] Remove window.Ember global
+ - [#19695](https://github.com/emberjs/ember.js/pull/19695) [CLEANUP] Remove {{partial}}
+ - [#19691](https://github.com/emberjs/ember.js/pull/19691) Add build assertion against `{{outlet named}}`
+- [#19680](https://github.com/emberjs/ember.js/pull/19680) [DEPRECATION] Deprecate owner.inject per [RFC #680](https://github.com/emberjs/rfcs/blob/sn/owner-inject-deprecation/text/0680-implicit-injection-deprecation.md#1-deprecate-implicit-injection-on-target-object) and cleanup related deprecations that are `until: 4.0.0`.
+- [#19649](https://github.com/emberjs/ember.js/pull/19649) / [#19692](https://github.com/emberjs/ember.js/pull/19692) [DEPRECATION] Add deprecation warning to Ember.assign implementing [RFC #750](https://github.com/emberjs/rfcs/blob/master/text/0750-deprecate-ember-assign.md).
+- [#19825](https://github.com/emberjs/ember.js/pull/19825) [BUGFIX] Replace `assert.equal` in blueprints with `assert.strictEqual` to pass eslint-plugin-qunit v7 on generation
+- [#19227](https://github.com/emberjs/ember.js/pull/19227) [BUGFIX] Enable global event dispatcher listeners to be lazily created fixing Passive Listener Violation in Chrome
+- [#19542](https://github.com/emberjs/ember.js/pull/19542) [BUGFIX] Fix initializer test blueprints
+- [#19589](https://github.com/emberjs/ember.js/pull/19589) [BUGFIX] Don’t include type-tests in build output
+
+## v3.28.8 (December 2, 2021)
+
+- [#19868](https://github.com/emberjs/ember.js/pull/19868) [BUGFIX] Fix a bug with the implicit injections deprecation that meant injecting a store to avoid the deprecation did not work.
+
+## v3.28.7 (December 1, 2021)
+
+- [#19854](https://github.com/emberjs/ember.js/pull/19854) [BUGFIX] Fix implicit injections deprecation for routes to cover previously missed cases
+- [#19857](https://github.com/emberjs/ember.js/pull/19857) [BUGFIX] Improve assert message in default store for when routes have dynamic segments but no model hook
+
+## v3.28.6 (November 4, 2021)
+
+- [#19683](https://github.com/emberjs/ember.js/pull/19683) Ensure super.willDestroy is called correctly in Router's willDestroy
+
+## v3.28.5 (November 3, 2021)
+
+- [#19820](https://github.com/emberjs/ember.js/pull/19820) Fix memory leak when looking up non-instantiable objects from the owner
+
+## v3.28.4 (October 22, 2021)
+
+- [#19798](https://github.com/emberjs/ember.js/pull/19798) More fixes for errors while precompiling inline templates (introduced in 3.28.2)
+- [glimmerjs/glimmer-vm@0.80.3](https://github.com/glimmerjs/glimmer-vm/releases/tag/v0.80.3) Improve template compilation speed regression
+
+## v3.28.3 (October 22, 2021)
+
+- [#19799](https://github.com/emberjs/ember.js/pull/19799) / [glimmerjs/glimmer-vm#1354](https://github.com/glimmerjs/glimmer-vm/pull/1354) Fixes for errors while precompiling inline templates (introduced in 3.28.2)
+
+## v3.28.2 (October 21, 2021)
+
+- [glimmerjs/glimmer-vm#1351](https://github.com/glimmerjs/glimmer-vm/pull/1351) Support lexical scope in loose mode
+
+## v3.24.6 (October 18, 2021)
+
+- [glimmerjs/glimmer-vm#1347](https://github.com/glimmerjs/glimmer-vm/pull/1347) Avoid using a nested WeakMap for manager instances for a given owner (makes memory leak debugging easier)
+
+## v3.28.1 (August 30, 2021)
+
+- [#19733](https://github.com/emberjs/ember.js/pull/19733) [BUGFIX] Ensure that using `routerService.urlFor(...)` and `routerService.recognize(...)` does not error if the router is not fully initialized
+
+## v3.28.0 (August 9, 2021)
+
+- [#19697](https://github.com/emberjs/ember.js/pull/19697) [BUGFIX] Ensure `deserializeQueryParam` is called for lazy routes
+- [#19681](https://github.com/emberjs/ember.js/pull/19681) [BUGFIX] Restore previous hash behavior
+- [#19685](https://github.com/emberjs/ember.js/pull/19685) [BUGFIX] Fix memory leak in RouterService
+- [#19690](https://github.com/emberjs/ember.js/pull/19690) [BUGFIX] Deprecates String.prototype.htmlSafe targeting Ember 4.0, as intended by the original deprecation.
+- [#19584](https://github.com/emberjs/ember.js/pull/19584) [BUGFIX] Ensure hash objects correctly entangle as dependencies
+- [#19491](https://github.com/emberjs/ember.js/pull/19491) [BUGFIX] Fix `owner.lookup` `owner.register` behavior with `singleton: true` option
+- [#19472](https://github.com/emberjs/ember.js/pull/19472) [BUGFIX] Prevent transformation of block params called `attrs`
+
+## v3.24.5 (August 9, 2021)
+
+- [#19685](https://github.com/emberjs/ember.js/pull/19685) Fix memory leak with `RouterService` under Chrome
+- [#19683](https://github.com/emberjs/ember.js/pull/19683) Ensure `super.willDestroy` is called correctly in `Router`'s `willDestroy`
+
+## v3.27.5 (June 10, 2021)
+
+- [#19597](https://github.com/emberjs/ember.js/pull/19597) [BIGFIX] Fix `` with nested children
+
+## v3.27.4 (June 9, 2021)
+
+- [#19594](https://github.com/emberjs/ember.js/pull/19594) [BUGFIX] Revert lazy hash changes
+- [#19596](https://github.com/emberjs/ember.js/pull/19596) [DOC] Fix "Dormant" addon warning typo
+
+## v3.27.3 (June 3, 2021)
+
+- [#19565](https://github.com/emberjs/ember.js/pull/19565) [BUGFIX] Ensures that `computed` can depend on dynamic `(hash` keys
+- [#19571](https://github.com/emberjs/ember.js/pull/19571) [BUGFIX] Extend `Route.prototype.transitionTo` deprecation until 5.0.0
+- [#19586](https://github.com/emberjs/ember.js/pull/19586) [BUGFIX] Fix Embroider compatibility
+
+## v3.27.2 (May 27, 2021)
+
+- [#19511](https://github.com/emberjs/ember.js/pull/19511) / [#19548](https://github.com/emberjs/ember.js/pull/19548) [BUGFIX] Makes the (hash) helper lazy
+- [#19530](https://github.com/emberjs/ember.js/pull/19530) [DOC] fix passing params to named blocks examples
+- [#19536](https://github.com/emberjs/ember.js/pull/19536) [BUGFIX] Fix `computed.*` deprecation message to include the correct import path
+- [#19544](https://github.com/emberjs/ember.js/pull/19544) [BUGFIX] Use explicit this in helper test blueprints
+- [#19555](https://github.com/emberjs/ember.js/pull/19555) [BUGFIX] Improve class based tranform deprecation message
+- [#19557](https://github.com/emberjs/ember.js/pull/19557) [BUGFIX] Refine Ember Global deprecation message
+- [#19564](https://github.com/emberjs/ember.js/pull/19564) [BUGFIX] Improve computed.* and run.* deprecation message (IE11)
+
+## v3.27.1 (May 13, 2021)
+
+- [#19540](https://github.com/emberjs/ember.js/pull/19540) [BUGFIX] Ensure ember-testing is loaded lazily
+- [#19541](https://github.com/emberjs/ember.js/pull/19541) [BUGFIX] Add missing metadata for some deprecations enabled in 3.27.0
+- [#19541](https://github.com/emberjs/ember.js/pull/19541) [BUGFIX] Ensure passing `@href` to `` throws an error
+- [#19541](https://github.com/emberjs/ember.js/pull/19541) [CLEANUP] Consistently use https://deprecations.emberjs.com/ in deprecation URLs
+
+## v3.27.0 (May 3, 2021)
+
+- [#19309](https://github.com/emberjs/ember.js/pull/19309) / [#19487](https://github.com/emberjs/ember.js/pull/19487) / [#19474](https://github.com/emberjs/ember.js/pull/19474) [FEATURE] Enable `(helper` and `(modifier` helpers per [RFC #432](https://github.com/emberjs/rfcs/blob/master/text/0432-contextual-helpers.md).
+- [#19382](https://github.com/emberjs/ember.js/pull/19382) / [#19430](https://github.com/emberjs/ember.js/pull/19430) [FEATURE] Remaining implementation work per [RFC #671](https://github.com/emberjs/rfcs/blob/master/text/0671-modernize-built-in-components-1.md).
+- [#19457](https://github.com/emberjs/ember.js/pull/19457) / [#19463](https://github.com/emberjs/ember.js/pull/19463) / [#19464](https://github.com/emberjs/ember.js/pull/19464) / [#19467](https://github.com/emberjs/ember.js/pull/19467) [DEPRECATION] Add deprecation for the Ember Global per [RFC #706](https://github.com/emberjs/rfcs/blob/master/text/0706-deprecate-ember-global.md).
+- [#19407](https://github.com/emberjs/ember.js/pull/19407) [DEPRECATION] Add deprecation for `Route#disconnectOutlet` per [RFC #491](https://github.com/emberjs/rfcs/blob/master/text/0491-deprecate-disconnect-outlet.md).
+- [#19433](https://github.com/emberjs/ember.js/pull/19433) [DEPRECATION] Add deprecation for `Route#renderTemplate` per [RFC #418](https://github.com/emberjs/rfcs/blob/master/text/0418-deprecate-route-render-methods.md).
+- [#19442](https://github.com/emberjs/ember.js/pull/19442) [DEPRECATION] Add deprecation for `Route#render` method per [RFC #418](https://github.com/emberjs/rfcs/blob/master/text/0418-deprecate-route-render-methods.md).
+- [#19429](https://github.com/emberjs/ember.js/pull/19429) [DEPRECATION] `registerPlugin` / `unregisterPlugin` and legacy class based AST plugins (private APIs)
+- [#19499](https://github.com/emberjs/ember.js/pull/19499) [DEPRECATION] Deprecate `@foo={{helper}}` per [RFC #496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers).
+- [#19499](https://github.com/emberjs/ember.js/pull/19499) [BUGFIX] Update rendering engine to `@glimmer/*` 0.78.2 for fixes including:
+ - `<:else>` and `<:inverse>` should be aliases (see https://github.com/glimmerjs/glimmer-vm/pull/1296)
+ - Fix nested calls to helpers in dynamic helpers (see https://github.com/glimmerjs/glimmer-vm/pull/1293)
+- [#19477](https://github.com/emberjs/ember.js/pull/19477) [BUGFIX] Allow `` to override internal assertion
+- [#19481](https://github.com/emberjs/ember.js/pull/19481) [BUGFIX] Export `on` from correct path
+- [#19466](https://github.com/emberjs/ember.js/pull/19466) [BUGFIX] Rename private runloop functions
+- [#19384](https://github.com/emberjs/ember.js/pull/19384) Use qunit-dom in helper and component test blueprints
+- [#19390](https://github.com/emberjs/ember.js/pull/19390) Refactor the internal Ember loader to use the standard Ember CLI loader
+- [#19441](https://github.com/emberjs/ember.js/pull/19441) Add automated publishing of weekly alpha releases to NPM
+- [#19462](https://github.com/emberjs/ember.js/pull/19462) Use `positional` and `named` as the argument names in `ember g helper` blueprint
+
+## v3.24.4 (May 3, 2021)
+
+- [#19477](https://github.com/emberjs/ember.js/pull/19477) Allow `` to override internal assertion
+
+## v3.26.2 (October 4, 2021)
+
+- [#19683](https://github.com/emberjs/ember.js/pull/19683) [BUGFIX] Use `super.willDestroy` in native classes (instead of `this._super`)
+
+## v3.26.1 (March 24, 2021)
+
+- [#19473](https://github.com/emberjs/ember.js/pull/19473) Update Glimmer VM to latest.
+
+## v3.26.0 (March 22, 2021)
+
+- [#19255](https://github.com/emberjs/ember.js/pull/19255) [DEPRECATION] Deprecate transition methods of controller and route per [RFC #674](https://github.com/emberjs/rfcs/blob/master/text/0674-deprecate-transition-methods-of-controller-and-route.md).
+- [#19345](https://github.com/emberjs/ember.js/pull/19345) [DEPRECATION] Deprecate `` positional arguments per [RFC #698](https://github.com/emberjs/rfcs/blob/master/text/0698-deprecate-link-to-positional-arguments.md).
+- [#19346](https://github.com/emberjs/ember.js/pull/19346) [DEPRECATION] Deprecate `{{#with}}` per [RFC #445](https://github.com/emberjs/rfcs/blob/master/text/0445-deprecate-with.md)
+- [#19358](https://github.com/emberjs/ember.js/pull/19358) [DEPRECATION] Deprecate implicit injections per [RFC #680](https://github.com/emberjs/rfcs/blob/master/text/0680-implicit-injection-deprecation.md)
+- [#19359](https://github.com/emberjs/ember.js/pull/19359) [DEPRECATION] Deprecates old browser support policy per [RFC #685 New Browser Support Policy](https://github.com/emberjs/rfcs/blob/master/text/0685-new-browser-support-policy.md).
+- [#19371](https://github.com/emberjs/ember.js/pull/19371) [DEPRECATION] Deprecate implicit `this` property lookup fallback per [RFC #308]https://github.com/emberjs/rfcs/blob/master/text/0308-deprecate-property-lookup-fallback.md
+- [#19372](https://github.com/emberjs/ember.js/pull/19372) [DEPRECATION] Adds deprecations for Classic edition and optional features per [RFC #704](https://github.com/emberjs/rfcs/blob/master/text/0704-deprecate-octane-optional-features.md) and [RFC #705](https://github.com/emberjs/rfcs/blob/master/text/0705-deprecate-jquery-optional-feature.md).
+- [#19373](https://github.com/emberjs/ember.js/pull/19373) [DEPRECATION] Deprecate old manager capabilities per [RFC #686](https://github.com/emberjs/rfcs/blob/master/text/0686-deprecate-old-manager-capabilities-versions.md)
+- [#19374](https://github.com/emberjs/ember.js/pull/19374) [DEPRECATION] Deprecate `hasBlock` and `hasBlockParams` per [RFC #689](https://github.com/emberjs/rfcs/blob/master/text/0689-deprecate-has-block.md).
+- [#19375](https://github.com/emberjs/ember.js/pull/19375) [DEPRECATION] Deprecate old class binding syntax and {{attrs}} per [RFC #691](https://github.com/emberjs/rfcs/blob/master/text/0691-deprecate-class-binding-and-class-name-bindings.md) and [RFC #690](https://github.com/emberjs/rfcs/blob/master/text/0690-deprecate-attrs-in-templates.md).
+- [#19381](https://github.com/emberjs/ember.js/pull/19381) [DEPRECATION] Deprecate Array Observers per [RFC #692](https://github.com/emberjs/rfcs/blob/master/text/0692-deprecate-array-observers.md).
+- [#19379](https://github.com/emberjs/ember.js/pull/19379) [CLEANUP] Refactor DataAdapter to not use observers or array observers
+- [#19378](https://github.com/emberjs/ember.js/pull/19378) [BUGFIX] Fix typo in template-only-glimmer-components feature detection
+- [#19298](https://github.com/emberjs/ember.js/pull/19298) [BUGFIX] Route serialize did not extract param off proxy
+- [#19469](https://github.com/emberjs/ember.js/pull/19469) [BUGFIX] Prevent eager argument consumption on modifier destruction
+- [#19405](https://github.com/emberjs/ember.js/pull/19405) [BUGFIX] Avoid instantiation errors when `app/router.js` injects the router service.
+- [#19436](https://github.com/emberjs/ember.js/pull/19436) [BUGFIX] Support observer keys with colons
+
+## v3.25.4 (March 24, 2021)
+
+- [#19473](https://github.com/emberjs/ember.js/pull/19473) Update Glimmer VM to latest.
+
+## v3.25.3 (March 7, 2021)
+
+- [#19448](https://github.com/emberjs/ember.js/pull/19448) Ensure query params are preserved through an intermediate loading state transition
+- [#19450](https://github.com/emberjs/ember.js/pull/19450) Ensure `routerService.currentRoute.name` and `routerService.currentRouteName` match during loading states
+
+
+## v3.25.2 (March 7, 2021)
+
+- [#19389](https://github.com/emberjs/ember.js/pull/19389) Removes template ids
+- [#19395](https://github.com/emberjs/ember.js/pull/19395) [BUGFIX] Ensure `` can return a valid `href` most of the time
+- [#19396](https://github.com/emberjs/ember.js/pull/19396) [BUGFIX] Revert deprecation of htmlSafe and isHTMLSafe
+- [#19397](https://github.com/emberjs/ember.js/pull/19397) [BUGFIX] Force building Ember bundles when `targets.node` is defined
+- [#19399](https://github.com/emberjs/ember.js/pull/19399) [DOC] Update ArrayProxy Documentation
+- [#19412](https://github.com/emberjs/ember.js/pull/19412) / [#19416](https://github.com/emberjs/ember.js/pull/19416) [BUGFIX] Update Glimmer VM to 0.77 (fix dynamic helpers/modifiers)
+
+
+## v3.25.1 (February 10, 2021)
+
+- [#19326](https://github.com/emberjs/ember.js/pull/19326) / [#19387](https://github.com/emberjs/ember.js/pull/19387) [BUGFIX] Fix usage of `` prior to routing (e.g. component rendering tests)
+
+## v3.25.0 (February 08, 2021)
+
+- [#19302](https://github.com/emberjs/ember.js/pull/19302) / [#19306](https://github.com/emberjs/ember.js/pull/19306) / [#19319](https://github.com/emberjs/ember.js/pull/19319) [FEATURE] Implement the [Handlebars Strict Mode RFC](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md).
+- [#19318](https://github.com/emberjs/ember.js/pull/19318) [FEATURE] Implement the [Named Blocks RFC](https://github.com/emberjs/rfcs/blob/master/text/0460-yieldable-named-blocks.md).
+- [#19339](https://github.com/emberjs/ember.js/pull/19339) [DEPRECATION] Deprecate importing `htmlSafe` and `isHTMLSafe` from `@ember/string` per the [Deprecate Ember String RFC](https://github.com/emberjs/rfcs/blob/master/text/0236-deprecation-ember-string.md).
+- [#19320](https://github.com/emberjs/ember.js/pull/19320) / [#19317](https://github.com/emberjs/ember.js/pull/19317) / [#19297](https://github.com/emberjs/ember.js/pull/19297) / [#19293](https://github.com/emberjs/ember.js/pull/19293) / [#19278](https://github.com/emberjs/ember.js/pull/19278) / [#19275](https://github.com/emberjs/ember.js/pull/19275) / [#19363](https://github.com/emberjs/ember.js/pull/19363) Update rendering engine to `@glimmer/*` 0.74.2 for various features and bugfixes including ensuring `{{component.name}}` works with implicit this fallback
+- [#18148](https://github.com/emberjs/ember.js/pull/18148) [BUGFIX] Fix empty `htmlSafe` string to be treated as falsy
+- [#19365](https://github.com/emberjs/ember.js/pull/19365) [BUGFIX] Remove non-existing re-export from helper-addon blueprint
+- [#19370](https://github.com/emberjs/ember.js/pull/19370) [BUGFIX] Update glimmer-vm to prevent errors for older inline precompilation
+- [#19351](https://github.com/emberjs/ember.js/pull/19351) [BUGFIX] Ensure locals do not clobber components of the same name
+- [#19336](https://github.com/emberjs/ember.js/pull/19336) [BUGFIX] Ensure Component Lookup Is Well Formed
+- [#19338](https://github.com/emberjs/ember.js/pull/19338) [BUGFIX] Add missing `deprecate` options (`for` + `since`)
+- [#19342](https://github.com/emberjs/ember.js/pull/19342) [BUGFIX] Fix misleading LinkTo error message
+
+## v3.24.3 (March 7, 2021)
+
+- [#19448](https://github.com/emberjs/ember.js/pull/19448) Ensure query params are preserved through an intermediate loading state transition
+- [#19450](https://github.com/emberjs/ember.js/pull/19450) Ensure `routerService.currentRoute.name` and `routerService.currentRouteName` match during loading states
+- [#19395](https://github.com/emberjs/ember.js/pull/19395) [BUGFIX] Ensure `` can return a valid `href` most of the time
+- [#19397](https://github.com/emberjs/ember.js/pull/19397) [BUGFIX] Force building Ember bundles when `targets.node` is defined
+
+
+## v3.24.2 (February 10, 2021)
+
+- [#19326](https://github.com/emberjs/ember.js/pull/19326) / [#19387](https://github.com/emberjs/ember.js/pull/19387) [BUGFIX] Fix usage of `` prior to routing (e.g. component rendering tests)
+
+## v3.24.1 (January 14, 2021)
+
+- [#19337](https://github.com/emberjs/ember.js/pull/19337) [BUGFIX] Ensure query param only `` are properly scoped in engines
+
+## v3.24.0 (December 28, 2020)
+
+- [#19224](https://github.com/emberjs/ember.js/pull/19224) [FEATURE] Add `{{page-title}}` helper to route template blueprints to implement [RFC #0654](https://github.com/emberjs/rfcs/blob/master/text/0645-add-ember-page-title-addon.md).
+- [#19133](https://github.com/emberjs/ember.js/pull/19133) [FEATURE / DEPRECATION] Add new options to `deprecate()` for `for` and `since` and deprecate using `deprecate()` without those options per the [Deprecation Staging RFC](https://github.com/emberjs/rfcs/blob/master/text/0649-deprecation-staging.md).
+- [#19211](https://github.com/emberjs/ember.js/pull/19211) [DEPRECATION] Deprecate `Ember.String.loc` and `{{loc}}` per the [Deprecate Ember String RFC](https://github.com/emberjs/rfcs/blob/master/text/0236-deprecation-ember-string.md).
+- [#19234](https://github.com/emberjs/ember.js/pull/19234) [DEPRECATION] Deprecate String Prototype extensions per the [Deprecate Ember String RFC](https://github.com/emberjs/rfcs/blob/master/text/0236-deprecation-ember-string.md).
+- [#19254](https://github.com/emberjs/ember.js/pull/19254) [DEPRECATION] Deprecate tryInvoke to implement the [Deprecate `tryInvoke` RFC](https://github.com/emberjs/rfcs/blob/master/text/0673-deprecate-tryinvoke.md).
+- [#19080](https://github.com/emberjs/ember.js/pull/19080) [BUGFIX] Lazily setup the router in non-application tests
+- [#19253](https://github.com/emberjs/ember.js/pull/19253) [BUGFIX] Correct return of getComponentTemplate from null to undefined to align with original RFC (#481)
+- [#19223](https://github.com/emberjs/ember.js/pull/19223) [BUGFIX] `` should link within the engine when used inside one
+- [#19280](https://github.com/emberjs/ember.js/pull/19280) [BUGFIX] Ensure aliases cause recompute of a computed property when used with `@each` in the dependent keys of that property
+- [#19196](https://github.com/emberjs/ember.js/pull/19196) [CLEANUP] Remove EMBER_GLIMMER_IN_ELEMENT feature flag
+- [#19204](https://github.com/emberjs/ember.js/pull/19204) [CLEANUP] Remove EMBER_CACHE_API feature flag
+- [#19206](https://github.com/emberjs/ember.js/pull/19206) [CLEANUP] Remove EMBER_ROUTING_MODEL_ARG feature flag
+- [#19229](https://github.com/emberjs/ember.js/pull/19229) [CLEANUP] Remove the EMBER_GLIMMER_SET_COMPONENT_TEMPLATE feature flag
+- [#19238](https://github.com/emberjs/ember.js/pull/19238) [CLEANUP] Removes the `expandLocalLookup` API
+- [#19258](https://github.com/emberjs/ember.js/pull/19258) / [#19261](https://github.com/emberjs/ember.js/pull/19261) / [#19267](https://github.com/emberjs/ember.js/pull/19267) Update rendering engine to 0.65.0
+
+## v3.23.1 (November 23, 2020)
+
+- [#19282](https://github.com/emberjs/ember.js/pull/19282) [BUGFIX] Issue deprecations (instead of assertions) for tracked mutation in constructor during rendering
+
+## v3.23.0 (November 16, 2020)
+
+- [#19160](https://github.com/emberjs/ember.js/pull/19160) / [#19182](https://github.com/emberjs/ember.js/pull/19182) [FEATURE] Implements the helper manager feature specified in the [Helper Managers RFC](https://github.com/emberjs/rfcs/blob/master/text/0625-helper-managers.md).
+- [#19171](https://github.com/emberjs/ember.js/pull/19171) / [#19182](https://github.com/emberjs/ember.js/pull/19182) [FEATURE] Implements `invokeHelper` from the [JavaScript Helper Invocation API RFC](https://github.com/emberjs/rfcs/blob/master/text/0626-invoke-helper.md).
+- [#19148](https://github.com/emberjs/ember.js/pull/19148) / [#19119](https://github.com/emberjs/ember.js/pull/19119) Update rendering engine to `@glimmer/*` 0.62.1
+- [#19122](https://github.com/emberjs/ember.js/pull/19122) [BUGFIX] Prevents dynamic invocations of string values when referenced directly in angle brackets
+- [#19136](https://github.com/emberjs/ember.js/pull/19136) [BUGFIX] Update router microlib to improve Transition related debugging
+- [#19173](https://github.com/emberjs/ember.js/pull/19173) [BUGFIX] Enforce usage of `capabilities` generation.
+- [#19236](https://github.com/emberjs/ember.js/pull/19236) [BUGFIX] Only serialize query params once on activeTransition
+- [#19250](https://github.com/emberjs/ember.js/pull/19250) [BUGFIX] Prevents infinite rerenders when errors occur during render
+- [#19249](https://github.com/emberjs/ember.js/pull/19249) [BUGFIX] Fix bugs in query params with intermediate transitions
+- [#19142](https://github.com/emberjs/ember.js/pull/19142) [BUGFIX] Fix App booting before DOM ready without jQuery
+- [#19198](https://github.com/emberjs/ember.js/pull/19198) / [#19232](https://github.com/emberjs/ember.js/pull/19232) [BUGFIX] Restores the shadowed property set behavior
+- [#19221](https://github.com/emberjs/ember.js/pull/19221) [BUGFIX] Ensure fn and (mut) work with falsy values
+- [#19213](https://github.com/emberjs/ember.js/pull/19213) [BUGFIX] Update rendering engine to improve error ergonomics.
+
+## v3.22.2 (November 25, 2020)
+
+- [#19282](https://github.com/emberjs/ember.js/pull/19282) [BUGFIX] Issue deprecations (instead of assertions) for tracked mutation in constructor during rendering
+- [#19263](https://github.com/emberjs/ember.js/pull/19263) [BUGFIX] Remove `@dependentKeyCompat` assertion
+
+## v3.22.1 (November 10, 2020)
+
+- [#19193](https://github.com/emberjs/ember.js/pull/19193) [BUGFIX] Ensure `@ember/component` user lifecycle hooks are untracked
+- [#19197](https://github.com/emberjs/ember.js/pull/19197) [BUGFIX] Restore the shadowed property set behavior
+- [#19199](https://github.com/emberjs/ember.js/pull/19199) [BUGFIX] Cleans up the DebugRenderTree more thoroughly on errors
+- [#19249](https://github.com/emberjs/ember.js/pull/19249) [BUGFIX] Fix issues with query params during intermediate transitions
+
+## v3.22.0 (October 5, 2020)
+
+- [#19062](https://github.com/emberjs/ember.js/pull/19062) / [#19068](https://github.com/emberjs/ember.js/pull/19068) [FEATURE] Add @ember/destroyable feature from the [Destroyables RFC](https://github.com/emberjs/rfcs/blob/master/text/0580-destroyables.md).
+- [#18984](https://github.com/emberjs/ember.js/pull/18984) / [#19067](https://github.com/emberjs/ember.js/pull/19067) [FEATURE] Add low-level Cache API per [Autotracking Memoization RFC](https://github.com/emberjs/rfcs/blob/master/text/0615-autotracking-memoization.md)
+- [#19086](https://github.com/emberjs/ember.js/pull/19086) [FEATURE] Pass transition object to activate/deactivate hooks and events
+- [#19094](https://github.com/emberjs/ember.js/pull/19094) [BUGFIX] Fix RouterService#isActive() to work with tracking
+- [#19163](https://github.com/emberjs/ember.js/pull/19163) [BUGFIX] Use args proxy for modifier managers.
+- [#19170](https://github.com/emberjs/ember.js/pull/19170) [BUGFIX] Make modifier manager 3.22 accept the resolved value directly.
+- [#19124](https://github.com/emberjs/ember.js/pull/19124) [BUGFIX] Fix rendering engine usage within a `fastboot` sandbox
+
+## v3.21.3 (September 30, 2020)
+
+- [#19172](https://github.com/emberjs/ember.js/pull/19172) [BUGFIX] Ensures that tracked properties initialize property
+
+## v3.21.2 (September 30, 2020)
+
+- [#19138](https://github.com/emberjs/ember.js/pull/19138) [BUGFIX] Fix tag cycles in query parameters
+- [#19164](https://github.com/emberjs/ember.js/pull/19164) [BUGFIX] Entangles custom EmberArray implementations when accessed with `Ember.get`
+
+## v3.21.1 (August 28, 2020)
+
+- [#19106](https://github.com/emberjs/ember.js/pull/19106) [BUGFIX] Ensure `destroy` methods on `CoreObject` are invoked.
+- [#19111](https://github.com/emberjs/ember.js/pull/19111) [BUGFIX] Fixes `ArrayProxy` length reactivity.
+
+## v3.21.0 (August 24, 2020)
+
+- [#18993](https://github.com/emberjs/ember.js/pull/18993) [DEPRECATION] Deprecate `getWithDefault` per [RFC #554](https://github.com/emberjs/rfcs/blob/master/text/0554-deprecate-getwithdefault.md).
+- [#19087](https://github.com/emberjs/ember.js/pull/19087) [BUGFIX] Generated initializer tests no longer causes a deprecation warning
+- [#17571](https://github.com/emberjs/ember.js/pull/17571) [BUGFIX] Avoid tampering `queryParam` argument in RouterService#isActive
+
+## v3.20.6 (November 11, 2020)
+
+- [#19138](https://github.com/emberjs/ember.js/pull/19138) [BUGFIX] Fix tag cycles in query parameters
+- [#19158](https://github.com/emberjs/ember.js/pull/19158) [BUGFIX] `RouterService#isActive()` now consumes `currentURL` to 3.20
+- [#19164](https://github.com/emberjs/ember.js/pull/19164) [BUGFIX] Entangles custom EmberArray implementations when accessed
+- [#19172](https://github.com/emberjs/ember.js/pull/19172) / [#19197](https://github.com/emberjs/ember.js/pull/19197) [BUGFIX] Ensures that tracked properties initialize property
+- [#19178](https://github.com/emberjs/ember.js/pull/19178) [BUGFIX] Allow computeds to have cycles in their deps
+
+## v3.20.5 (August 28, 2020)
+
+- [#19106](https://github.com/emberjs/ember.js/pull/19106) [BUGFIX] Ensure `destroy` methods on `CoreObject` are invoked.
+- [#19111](https://github.com/emberjs/ember.js/pull/19111) [BUGFIX] Fixes `ArrayProxy` length reactivity.
+
+## v3.20.4 (August 11, 2020)
+
+- [#19047](https://github.com/emberjs/ember.js/pull/19047) Ensure `inject-babel-helpers` plugin can be parallelized
+- [#19089](https://github.com/emberjs/ember.js/pull/19089) Update rendering engine to improve immediate encoding performance
+- [#19082](https://github.com/emberjs/ember.js/pull/19082) Simplify mixin application
+- [#19088](https://github.com/emberjs/ember.js/pull/19088) Simplify factory instantiation from the container
+- [#19028](https://github.com/emberjs/ember.js/pull/19028) Ensure setter CP's with dependent keys on curly components can be two way bound
+- [#19077](https://github.com/emberjs/ember.js/pull/19077) Simplify `get` and improve `computed` caching scheme.
+- [#19065](https://github.com/emberjs/ember.js/pull/19065) / [#19072](https://github.com/emberjs/ember.js/pull/19072) - Updates GlimmerVM to improve internal destroyable system and improve tag / revision computation.
+- [#19081](https://github.com/emberjs/ember.js/pull/19081) Reduces template compilation size in production builds.
+
+## v3.20.3 (July 30, 2020)
+
+- [#19048](https://github.com/emberjs/ember.js/pull/19048) [BUGFIX] Update `router.js` to ensure `transition.abort` works for query param only transitions
+- [#19059](https://github.com/emberjs/ember.js/pull/19059) [BUGFIX] Prevent `` from erroring in `HistoryLocation`
+- [#19060](https://github.com/emberjs/ember.js/pull/19060) [BUGFIX] Update rendering engine to `@glimmer/*` 0.55.1
+- [#19063](https://github.com/emberjs/ember.js/pull/19063) [DOC] Fix missing docs for `{{#in-element}}`
+
+## v3.20.2 (July 26, 2020)
+
+- [#19056](https://github.com/emberjs/ember.js/pull/19056) Update Glimmer rendering engine to 0.54.2. Fixes an issue with (private for now) destroyables work to enable the destroyables polyfill to work more appropriately.
+
+## v3.20.1 (July 13, 2020)
+
+- [#19040](https://github.com/emberjs/ember.js/pull/19040) [BUGFIX] Fix a memory leak that occurred when changing the array passed to `{{each}}`
+
+## v3.20.0 (July 13, 2020)
+
+- [#18867](https://github.com/emberjs/ember.js/pull/18867) / [#18927](https://github.com/emberjs/ember.js/pull/18927) / [#18928](https://github.com/emberjs/ember.js/pull/18928) [FEATURE] [Promote `{{in-element}}` to public API](https://github.com/emberjs/rfcs/blob/master/text/0287-promote-in-element-to-public-api.md) RFC.
+- [#19025](https://github.com/emberjs/ember.js/pull/19025) [BUGFIX] Updates Glimmer VM to 0.54.0
+- [#19021](https://github.com/emberjs/ember.js/pull/19021) [BUGFIX] Disallow null/undefined targets in `in-element`.
+- [#19023](https://github.com/emberjs/ember.js/pull/19023) [BUGFIX] Don't access properties during init unless required to prevent unnecessary rendering invalidations.
+- [#18997](https://github.com/emberjs/ember.js/pull/18997) [BUGFIX] Fix components `` and `
-
-
+
+
-
-
+
+
@@ -40,7 +40,7 @@ Find out more:
- [Blog](https://emberjs.com/blog)
- [Builds](https://emberjs.com/builds)
-# Contribution
+## Contributions
See [CONTRIBUTING.md](https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md)
diff --git a/RELEASE.md b/RELEASE.md
index d7d665f8e92..0d73816ad68 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -19,7 +19,7 @@
1. Check out `beta` branch and `git pull`
1. Make sure any master commits that are conceptually `[{BUGFIX,DOC} {beta,release}]` are cherry-picked.
-1. `git push origin beta`, and `let travisBranch = kick off a travis build`
+1. `git push origin beta`, and `let ciBranch = kick off a CI build`
1. `PRIOR_VERSION=v2.5.0-beta.1 ./bin/changelog.js | uniq | pbcopy`
1. Open `CHANGELOG.md`, paste in the results of the previous script, and clean it up for human-readability.
1. e.g. [BUGFIX beta] -> [BUGFIX], [DEPRECATE beta] -> [DEPRECATE], ...
@@ -27,14 +27,14 @@
1. rm [DOC] (usually)
1. rm other trivial things
1. Backport CHANGELOG to master
-1. `await travisBranch`
- 1. if travis succeeds, process
- 1. if travis fails and it's a fix that doesn't need to be on master (e.g. linting or merge conflicts accidentally checked in), fix and retry.
+1. `await ciBranch`
+ 1. if CI succeeds, process
+ 1. if CI fails and it's a fix that doesn't need to be on master (e.g. linting or merge conflicts accidentally checked in), fix and retry.
1. otherwise, start over
1. Update `package.json` and `VERSION` file to use new version number
1. git add/commit -m "Release v2.5.0-beta.2."
1. `git tag v2.5.0-beta.2`
-1. `git push origin v2.5.0-beta.2`, and `let travisTag = kick off a travis build` (to produce the assets)
+1. `git push origin v2.5.0-beta.2`, and `let ciTag = kick off a CI build` (to produce the assets)
1. `git push origin beta`
1. `git checkout beta`
1. `rm -rf dist && mkdir dist && cp ../components-ember/* dist/`
@@ -73,7 +73,7 @@ Starting point: [https://gist.github.com/rwjblue/fb945e55c70d698d4074](https://g
### Build Changelog
-1. Push `beta` branch to get Travis to run
+1. Push `beta` branch to get CI to run
1. Run `PRIOR_VERSION= ./bin/changelog.js | uniq | pbcopy`
1. Clean up commits in CHANGELOG
1. e.g. [BUGFIX beta] -> [BUGFIX], [DEPRECATE beta] -> [DEPRECATE], ...
@@ -94,8 +94,8 @@ Starting point: [https://gist.github.com/rwjblue/fb945e55c70d698d4074](https://g
### Release
-1. `git push origin v2.4.0` to push JUST the tag. This lets us run the tag first on Travis CI, which does the correct deploy to S3, Bower, etc.
-1. THEN wait for Travis CI build to finish
+1. `git push origin v2.4.0` to push JUST the tag. This lets us run the tag first on CI, which does the correct deploy to S3, Bower, etc.
+1. THEN wait for CI build to finish
1. Go to github and disable branch protection for the **release** branch
1. Backup the current release branch: `git push origin release:release-version`
1. To make this the current `release` branch: `git push -f origin beta:release`
@@ -132,9 +132,8 @@ end
1. Any feature that has been GOed gets changed to true
1. Run `ember s -prod`
1. Run tests at `http://localhost:4200/tests/index.html`
-2. Run production tests `http://localhost:4200/tests/index.html?dist=prod&prod=true`
-3. In `.travis.yml`, remove `branches:` section e.g. [this commit](https://github.com/emberjs/ember.js/commit/e38ec5d910721a9e02a819b4105a4875723f4b1b).
-4. Now we have to look at the commit just prior to branching 2.4.0.beta-1. Then find the commit after that to start the new branch at.
+1. Run production tests `http://localhost:4200/tests/index.html?dist=prod&prod=true`
+1. Now we have to look at the commit just prior to branching 2.4.0.beta-1. Then find the commit after that to start the new branch at.
### Changelog
diff --git a/bin/build-for-publishing.js b/bin/build-for-publishing.js
index 3128997b06a..bc5ca24e70b 100755
--- a/bin/build-for-publishing.js
+++ b/bin/build-for-publishing.js
@@ -1,5 +1,5 @@
'use strict';
-/* eslint-env node, es6 */
+/* eslint-env node */
const fs = require('fs');
const path = require('path');
@@ -56,7 +56,7 @@ Promise.resolve()
.then(() => {
updatePackageJSONVersion();
// ensures that we tag this correctly
- return exec('auto-dist-tag', ['--write']);
+ return exec('node_modules/.bin/auto-dist-tag', ['--write']);
})
.then(() => {
// do a production build
@@ -87,7 +87,7 @@ Promise.resolve()
.then(
// eslint-disable-next-line
() => console.log('build-for-publishing completed successfully!'),
- error => {
+ (error) => {
// eslint-disable-next-line
console.error(error);
// eslint-disable-next-line
diff --git a/bin/changelog.js b/bin/changelog.js
index c6f2caf68b4..6902f18c911 100755
--- a/bin/changelog.js
+++ b/bin/changelog.js
@@ -19,24 +19,98 @@ const GitHubApi = require('github');
const execSync = require('child_process').execSync;
const github = new GitHubApi({ version: '3.0.0' });
+if (process.env.GITHUB_TOKEN) {
+ github.authenticate({
+ type: 'token',
+ token: process.env.GITHUB_TOKEN,
+ });
+}
const compareCommits = RSVP.denodeify(github.repos.compareCommits);
+const getPullRequest = RSVP.denodeify(github.pullRequests.get);
const currentVersion = process.env.PRIOR_VERSION;
const head = process.env.HEAD || execSync('git rev-parse HEAD', { encoding: 'UTF-8' });
-compareCommits({
- user: 'emberjs',
- repo: 'ember.js',
- base: currentVersion,
- head: head,
-})
- .then(processPages)
+generateChangelog()
.then(console.log)
- .catch(err => console.error(err));
+ .catch((err) => console.error(err));
+
+async function fetchAllChanges() {
+ let result = await compareCommits({
+ user: 'emberjs',
+ repo: 'ember.js',
+ base: currentVersion,
+ head,
+ });
+ let data = result.commits;
+ while (github.hasNextPage(result)) {
+ result = await github.getNextPage(result);
+ data.concat(result.commits);
+ }
+
+ return data;
+}
+
+async function generateChangelog() {
+ let commits = await fetchAllChanges();
+
+ let contributions = commits.filter(excludeDependabot).filter(isMergeOrCherryPick);
+
+ let changes = await Promise.all(
+ contributions.map(async function (commitInfo) {
+ let message = await getCommitMessage(commitInfo);
+
+ let mergeFromBranchRegex = /#(\d+) from (.+)\//;
+ let mergePullRequestRegex = /Merge pull request #(\d+)/;
+ let mergeWithPrReferenceRegex = /\(#(\d+)\)$/m;
+ let result = {
+ sha: commitInfo.sha,
+ };
+
+ if (mergeFromBranchRegex.test(message)) {
+ let match = message.match(mergeFromBranchRegex);
+ result.number = match[1];
+ result.title = message.split('\n\n')[1];
+ } else if (mergePullRequestRegex.test(message)) {
+ let match = message.match(mergePullRequestRegex);
+ result.number = match[1];
+ result.title = message.split('\n\n')[1];
+ } else if (mergeWithPrReferenceRegex.test(message)) {
+ let match = message.match(mergeWithPrReferenceRegex);
+ result.number = match[1];
+ result.title = message.split('\n')[0];
+ } else {
+ result.title = message.split('\n\n')[0];
+ }
+
+ return result;
+ })
+ );
+
+ return changes
+ .sort(comparePrNumber)
+ .filter(uniqueByPrNumber)
+ .map((pr) => {
+ let title = pr.title;
+ let link;
+ if (pr.number) {
+ link =
+ '[#' + pr.number + ']' + '(https://github.com/emberjs/ember.js/pull/' + pr.number + ')';
+ } else {
+ link =
+ '[' + pr.sha.slice(0, 8) + '](https://github.com/emberjs/ember.js/commit/' + pr.sha + ')';
+ }
-function getCommitMessage(commitInfo) {
+ return '- ' + link + ' ' + title;
+ })
+ .join('\n');
+}
+
+async function getCommitMessage(commitInfo) {
let message = commitInfo.commit.message;
+ let matches;
+
if (message.indexOf('cherry picked from commit') > -1) {
let cherryPickRegex = /cherry picked from commit ([a-z0-9]+)/;
let originalCommit = cherryPickRegex.exec(message)[1];
@@ -56,11 +130,29 @@ function getCommitMessage(commitInfo) {
}
}
+ if ((matches = message.match(/^Merge pull request #(\d+)/))) {
+ // if the commit was a merge from a PR and there's no additional content in
+ // the commit message (which is normally the title of the merged PR) then
+ // hit the Github API for the PR to get the title.
+ let prNumber = matches[1];
+
+ let lines = message.split(/\n\n/);
+
+ if (!lines[1]) {
+ let pullRequest = await getPullRequest({
+ user: 'emberjs',
+ repo: 'ember.js',
+ number: prNumber,
+ });
+ return `Merge pull request #${prNumber}\n\n${pullRequest.title}`;
+ }
+ }
+
return message;
}
function excludeDependabot(commitInfo) {
- let author = commitInfo.author.login;
+ let author = commitInfo.author && commitInfo.author.login;
return author !== 'dependabot-preview[bot]' && author !== 'dependabot[bot]';
}
@@ -72,61 +164,21 @@ function isMergeOrCherryPick(commitInfo) {
}
function comparePrNumber(a, b) {
+ if (a.number && !b.number) return -1;
+ if (!a.number && b.number) return 1;
+ if (!a.number && !b.number) {
+ if (a.sha < b.sha) return -1;
+ if (a.sha > b.sha) return 1;
+ return 0;
+ }
+
if (a.number < b.number) return -1;
if (a.number > b.number) return 1;
return 0;
}
-function processPages(res) {
- let contributions = res.commits
- .filter(excludeDependabot)
- .filter(isMergeOrCherryPick)
- .map(commitInfo => {
- let message = getCommitMessage(commitInfo);
-
- let mergeFromBranchRegex = /#(\d+) from (.*)\//;
- let mergeWithPrReferenceRegex = /\(#(\d+)\)$/m;
- let result = {
- sha: commitInfo.sha,
- };
-
- if (mergeFromBranchRegex.test(message)) {
- let match = message.match(mergeFromBranchRegex);
- let numAndAuthor = match.slice(1, 3);
-
- result.number = numAndAuthor[0];
- result.title = message.split('\n\n')[1];
- } else if (mergeWithPrReferenceRegex.test(message)) {
- let match = message.match(mergeWithPrReferenceRegex);
- result.number = match[1];
- result.title = message.split('\n')[0];
- } else {
- result.title = message.split('\n\n')[0];
- }
-
- return result;
- })
- .sort(comparePrNumber)
- .map(pr => {
- let title = pr.title;
- let link;
- if (pr.number) {
- link =
- '[#' + pr.number + ']' + '(https://github.com/emberjs/ember.js/pull/' + pr.number + ')';
- } else {
- link =
- '[' + pr.sha.slice(0, 8) + '](https://github.com/emberjs/ember.js/commit/' + pr.sha + ')';
- }
-
- return '- ' + link + ' ' + title;
- })
- .join('\n');
-
- if (github.hasNextPage(res)) {
- return github.getNextPage(res).then(nextPage => {
- contributions += processPages(nextPage);
- });
- } else {
- return RSVP.resolve(contributions);
- }
+function uniqueByPrNumber(commitInfo, index, commits) {
+ const foundIndex = commits.findIndex(({ number }) => number === commitInfo.number);
+ // keep this item if it has a `number` that isn't elsewhere in the array, or doesn't have `number`
+ return foundIndex === index || foundIndex === -1;
}
diff --git a/bin/feature-flag-yuidoc-filter.js b/bin/feature-flag-yuidoc-filter.js
index 904c99c850b..6b3e1f3dc2c 100755
--- a/bin/feature-flag-yuidoc-filter.js
+++ b/bin/feature-flag-yuidoc-filter.js
@@ -48,7 +48,7 @@ function updateClassReferencesInNamespaces(data) {
}
}
-module.exports = function(data) {
+module.exports = function (data) {
let featuresToFilter = gatherFeatures();
data.classes = gatherClassesToDocument(data, featuresToFilter);
updateClassReferencesInNamespaces(data);
diff --git a/bin/next-alpha-version.js b/bin/next-alpha-version.js
new file mode 100644
index 00000000000..d8bb57ce99b
--- /dev/null
+++ b/bin/next-alpha-version.js
@@ -0,0 +1,23 @@
+/* eslint-disable no-console */
+
+'use strict';
+
+const BaseVersionRegex = /(\d+\.\d+\.0).*/;
+const AlphaCountRegex = /.*-alpha\.(\d+)/;
+
+const PackageVersion = require('../package.json').version;
+const LatestAlpha = process.argv.slice(2)[0];
+
+const BaseVersionFromPackageJSON = baseVersionFrom(PackageVersion);
+const BaseVersionFromLatestAlpha = baseVersionFrom(LatestAlpha);
+
+if (BaseVersionFromPackageJSON === BaseVersionFromLatestAlpha) {
+ const latestAlphaCount = Number(AlphaCountRegex.exec(LatestAlpha)[1]);
+ console.log(`${BaseVersionFromLatestAlpha}-alpha.${latestAlphaCount + 1}`);
+} else {
+ console.log(`${BaseVersionFromPackageJSON}-alpha.1`);
+}
+
+function baseVersionFrom(version) {
+ return BaseVersionRegex.exec(version)[1];
+}
diff --git a/bin/publish_builds b/bin/publish_builds
deleted file mode 100755
index fdf49065016..00000000000
--- a/bin/publish_builds
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-
-# ensure the first failure, stops the script
-set -e
-
-echo -e "CURRENT_BRANCH: ${TRAVIS_BRANCH}\n"
-echo -e "PULL_REQUEST: ${TRAVIS_PULL_REQUEST}\n"
-
-if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$PUBLISH" == "true" ]; then
-
- node ./bin/build-for-publishing.js
-
- node ./bin/publish_to_s3.js
-
- #### NPM PUBLISHING
- if [[ "$TRAVIS_TAG" =~ ^v[0-9.]+ ]]; then
- echo -e "CURRENT_TAG: ${TRAVIS_TAG}\n"
- echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}"> ~/.npmrc
-
- NPM_USER=$(npm whoami)
- echo -e "Publishing to npm as $NPM_USER...\n"
-
- # auto-dist-tag is ran by bin/build-for-publishing.js
- # this ensures that the `publishConfig` object in the `package.json`
- # indicates the correct tag to be published
- npm publish
- fi
-fi
diff --git a/bin/publish_to_s3.js b/bin/publish_to_s3.js
index 54db6c0681e..f857e7f136f 100755
--- a/bin/publish_to_s3.js
+++ b/bin/publish_to_s3.js
@@ -5,9 +5,6 @@ const buildInfo = require('../broccoli/build-info').buildInfo();
// To invoke this from the commandline you need the following to env vars to exist:
//
// S3_BUCKET_NAME
-// TRAVIS_BRANCH
-// TRAVIS_TAG
-// TRAVIS_COMMIT
// S3_SECRET_ACCESS_KEY
// S3_ACCESS_KEY_ID
//
@@ -21,9 +18,13 @@ if (!buildInfo.isBuildForTag) {
const S3Publisher = require('ember-publisher');
const configPath = require('path').join(__dirname, '../config/s3ProjectConfig.js');
- let publisher = new S3Publisher({ projectConfigPath: configPath });
+ let publisher = new S3Publisher({
+ projectConfigPath: configPath,
+ TRAVIS_TAG: buildInfo.tag,
+ TRAVIS_COMMIT: buildInfo.sha,
+ });
- publisher.currentBranch = function() {
+ publisher.currentBranch = function () {
return buildInfo.channel;
};
diff --git a/bin/run-browserstack-tests.js b/bin/run-browserstack-tests.js
index 8dd345a363f..60eb5435d60 100755
--- a/bin/run-browserstack-tests.js
+++ b/bin/run-browserstack-tests.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-console, node/no-unsupported-features/es-syntax */
+/* eslint-disable no-console */
const execa = require('execa');
const chalk = require('chalk');
@@ -13,7 +13,7 @@ function run(command, args = []) {
return p;
}
-(async function() {
+(async function () {
await run('ember', ['browserstack:connect']);
try {
@@ -34,7 +34,7 @@ function run(command, args = []) {
console.log('success');
process.exit(0);
} finally {
- if (process.env.TRAVIS_JOB_NUMBER) {
+ if (process.env.GITHUB_RUN_ID) {
await run('ember', ['browserstack:results']);
}
await run('ember', ['browserstack:disconnect']);
diff --git a/bin/run-tests-browser-runner.js b/bin/run-tests-browser-runner.js
index 01df5a98d4b..6c6fed31ca0 100644
--- a/bin/run-tests-browser-runner.js
+++ b/bin/run-tests-browser-runner.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-console, node/no-unsupported-features/es-syntax */
+/* eslint-disable no-console */
'use strict';
diff --git a/bin/run-tests-injection.js b/bin/run-tests-injection.js
index 86bc1df4c5a..57f75b8eb6c 100644
--- a/bin/run-tests-injection.js
+++ b/bin/run-tests-injection.js
@@ -2,12 +2,12 @@
/* eslint-disable no-console */
/* globals QUnit */
'use strict';
-document.addEventListener('DOMContentLoaded', function() {
+document.addEventListener('DOMContentLoaded', function () {
let testsTotal = 0;
let testsPassed = 0;
let testsFailed = 0;
let currentTestAssertions = [];
- QUnit.log(function(details) {
+ QUnit.log(function (details) {
let response;
// Ignore passing assertions
@@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', function() {
currentTestAssertions.push('Failed assertion: ' + response);
});
- QUnit.testDone(function(result) {
+ QUnit.testDone(function (result) {
let i,
len,
name = '';
@@ -58,13 +58,13 @@ document.addEventListener('DOMContentLoaded', function() {
currentTestAssertions.length = 0;
});
- QUnit.moduleDone(m => {
+ QUnit.moduleDone((m) => {
console.log(
`Module "${m.name}" finished ${m.total} tests${m.failed > 0 ? `${m.failed} failed` : ''}`
);
});
- QUnit.done(function(result) {
+ QUnit.done(function (result) {
console.log(
'\n' +
'Took ' +
diff --git a/bin/run-tests.js b/bin/run-tests.js
index 4d5e6d284d3..c414b603ec0 100755
--- a/bin/run-tests.js
+++ b/bin/run-tests.js
@@ -13,7 +13,7 @@ const fs = require('fs');
const serve = serveStatic('./dist/', { index: ['index.html', 'index.htm'] });
// Create server.
-const server = http.createServer(function(req, res) {
+const server = http.createServer(function (req, res) {
let done = finalhandler(req, res);
serve(req, res, done);
});
@@ -61,25 +61,19 @@ function generateTestsFor(packageName) {
testFunctions.push(() => run('package=' + packageName + '&edition=classic'));
testFunctions.push(() => run('package=' + packageName + '&prebuilt=true'));
testFunctions.push(() => run('package=' + packageName + '&enableoptionalfeatures=true'));
-
- // TODO: this should ultimately be deleted (when all packages can run with and
- // without jQuery)
- if (packageName !== 'ember') {
- testFunctions.push(() => run('package=' + packageName + '&jquery=none'));
- }
}
function generateEachPackageTests() {
fs.readdirSync('packages/@ember')
- .filter(e => e !== '-internals')
- .forEach(e => generateTestsFor(`@ember/${e}`));
+ .filter((e) => e !== '-internals')
+ .forEach((e) => generateTestsFor(`@ember/${e}`));
- fs.readdirSync('packages/@ember/-internals').forEach(e =>
+ fs.readdirSync('packages/@ember/-internals').forEach((e) =>
generateTestsFor(`@ember/-internals/${e}`)
);
fs.readdirSync('packages')
- .filter(e => e !== '@ember')
+ .filter((e) => e !== '@ember')
.forEach(generateTestsFor);
}
@@ -89,12 +83,6 @@ function generateStandardTests() {
testFunctions.push(() => run('enableoptionalfeatures=true'));
}
-function generateOldJQueryTests() {
- testFunctions.push(() => run('jquery=1.10.2'));
- testFunctions.push(() => run('jquery=1.12.4'));
- testFunctions.push(() => run('jquery=2.2.4'));
-}
-
function generateExtendPrototypeTests() {
testFunctions.push(() => run('extendprototypes=true'));
testFunctions.push(() => run('extendprototypes=true&enableoptionalfeatures=true'));
@@ -114,11 +102,11 @@ function runInSequence(tasks) {
function runAndExit() {
runInSequence(testFunctions)
- .then(function() {
+ .then(function () {
console.log(chalk.green('Passed!'));
process.exit(0);
})
- .catch(function(err) {
+ .catch(function (err) {
console.error(chalk.red(err.toString()));
console.error(chalk.red('Failed!'));
process.exit(1);
@@ -137,15 +125,13 @@ switch (process.env.TEST_SUITE) {
generateEachPackageTests();
runAndExit();
break;
- case 'old-jquery-and-extend-prototypes':
- console.log('suite: old-jquery-and-extend-prototypes');
- generateOldJQueryTests();
+ case 'extend-prototypes':
+ console.log('suite: extend-prototypes');
generateExtendPrototypeTests();
runAndExit();
break;
case 'all':
console.log('suite: all');
- generateOldJQueryTests();
generateExtendPrototypeTests();
generateEachPackageTests();
runAndExit();
diff --git a/bin/yarn-link-glimmer.js b/bin/yarn-link-glimmer.js
index 29310d2cfb4..d0288d23609 100755
--- a/bin/yarn-link-glimmer.js
+++ b/bin/yarn-link-glimmer.js
@@ -8,8 +8,8 @@ const yarnConfig = JSON.parse(
})
).data
);
-const linkedModules = yarnConfig.linkedModules.filter(m => m.startsWith('@glimmer/'));
+const linkedModules = yarnConfig.linkedModules.filter((m) => m.startsWith('@glimmer/'));
-linkedModules.forEach(mod => {
+linkedModules.forEach((mod) => {
child_process.execSync(`yarn link "${mod}"`);
});
diff --git a/bin/yarn-unlink-glimmer.js b/bin/yarn-unlink-glimmer.js
index cc4884fcb0a..7b9e240f85a 100755
--- a/bin/yarn-unlink-glimmer.js
+++ b/bin/yarn-unlink-glimmer.js
@@ -8,9 +8,9 @@ const yarnConfig = JSON.parse(
})
).data
);
-const linkedModules = yarnConfig.linkedModules.filter(m => m.startsWith('@glimmer/'));
+const linkedModules = yarnConfig.linkedModules.filter((m) => m.startsWith('@glimmer/'));
-linkedModules.forEach(mod => {
+linkedModules.forEach((mod) => {
child_process.execSync(`yarn unlink "${mod}"`);
});
diff --git a/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js b/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js
new file mode 100644
index 00000000000..b6038d964c8
--- /dev/null
+++ b/blueprints-js/acceptance-test/mocha-files/tests/acceptance/__name__-test.js
@@ -0,0 +1,24 @@
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import { expect } from 'chai';
+import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
+<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+describe('<%= friendlyTestName %>', function () {
+ let application;
+
+ beforeEach(function () {
+ application = startApp();
+ });
+
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
+ });
+
+ it('can visit /<%= dasherizedModuleName %>', function () {
+ visit('/<%= dasherizedModuleName %>');
+
+ return andThen(() => {
+ expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
+ });
+ });
+});
diff --git a/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js b/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js
new file mode 100644
index 00000000000..9f28e50b894
--- /dev/null
+++ b/blueprints-js/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js
@@ -0,0 +1,13 @@
+import { describe, it } from 'mocha';
+import { expect } from 'chai';
+import { setupApplicationTest } from '<%= modulePrefix %>/tests/helpers';
+import { visit, currentURL } from '@ember/test-helpers';
+
+describe('<%= friendlyTestName %>', function () {
+ setupApplicationTest();
+
+ it('can visit /<%= dasherizedModuleName %>', async function () {
+ await visit('/<%= dasherizedModuleName %>');
+ expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
+ });
+});
diff --git a/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js b/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js
new file mode 100644
index 00000000000..35b4c18f65b
--- /dev/null
+++ b/blueprints-js/acceptance-test/qunit-files/tests/acceptance/__name__-test.js
@@ -0,0 +1,12 @@
+import { test } from 'qunit';
+import moduleForAcceptance from '<%= testFolderRoot %>/tests/helpers/module-for-acceptance';
+
+moduleForAcceptance('<%= friendlyTestName %>');
+
+test('visiting /<%= dasherizedModuleName %>', function (assert) {
+ visit('/<%= dasherizedModuleName %>');
+
+ andThen(function () {
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
+ });
+});
diff --git a/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js b/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js
new file mode 100644
index 00000000000..07ae1fa1048
--- /dev/null
+++ b/blueprints-js/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { visit, currentURL } from '@ember/test-helpers';
+import { setupApplicationTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestName %>', function (hooks) {
+ setupApplicationTest(hooks);
+
+ test('visiting /<%= dasherizedModuleName %>', async function (assert) {
+ await visit('/<%= dasherizedModuleName %>');
+
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
+ });
+});
diff --git a/blueprints/component-addon/files/__root__/__path__/__name__.js b/blueprints-js/component-addon/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/component-addon/files/__root__/__path__/__name__.js
rename to blueprints-js/component-addon/files/__root__/__path__/__name__.js
diff --git a/blueprints/component-addon/native-files/__root__/__path__/__name__.js b/blueprints-js/component-class-addon/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/component-addon/native-files/__root__/__path__/__name__.js
rename to blueprints-js/component-class-addon/files/__root__/__path__/__name__.js
diff --git a/blueprints/component-class/files/__root__/__path__/__name__.js b/blueprints-js/component-class/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/component-class/files/__root__/__path__/__name__.js
rename to blueprints-js/component-class/files/__root__/__path__/__name__.js
diff --git a/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..f73315461e6
--- /dev/null
+++ b/blueprints-js/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,34 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupComponentTest } from 'ember-mocha';<% if (testType === 'integration') { %>
+import hbs from 'htmlbars-inline-precompile';<% } %>
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupComponentTest('<%= componentPathName %>', {
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ // needs: ['component:foo', 'helper:bar'],
+ unit: true,<% } %>
+ });
+
+ it('renders', function () {
+ <% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`<%= selfCloseComponent(componentName) %>`);
+ expect(this.$()).to.have.length(1);
+
+ // Template block usage:
+ this.render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ expect(this.$().text().trim()).to.equal('template block text');<% } else if(testType === 'unit') { %>// creates the component instance
+ let component = this.subject();
+ // renders the component on the page
+ this.render();
+ expect(component).to.be.ok;
+ expect(this.$()).to.have.length(1);<% } %>
+ });
+});
diff --git a/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..765ad7f3310
--- /dev/null
+++ b/blueprints-js/component-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,36 @@
+import { expect } from 'chai';
+import { describeComponent, it } from 'ember-mocha';<% if (testType === 'integration') { %>
+import hbs from 'htmlbars-inline-precompile';<% } %>
+
+describeComponent(
+ '<%= componentPathName %>',
+ '<%= friendlyTestDescription %>',
+ {
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ // needs: ['component:foo', 'helper:bar'],
+ unit: true,<% } %>
+ },
+ function () {
+ it('renders', function () {
+ <% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`<%= selfCloseComponent(componentName) %>`);
+ expect(this.$()).to.have.length(1);
+
+ // Template block usage:
+ this.render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ expect(this.$().text().trim()).to.equal('template block text');<% } else if(testType === 'unit') { %>// creates the component instance
+ let component = this.subject();
+ // renders the component on the page
+ this.render();
+ expect(component).to.be.ok;
+ expect(this.$()).to.have.length(1);<% } %>
+ });
+ }
+);
diff --git a/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..09e004001b3
--- /dev/null
+++ b/blueprints-js/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,38 @@
+<% if (testType === 'integration') { %>import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupRenderingTest();
+
+ it('renders', async function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<%= selfCloseComponent(componentName) %>`);
+
+ expect(this.element.textContent.trim()).to.equal('');
+
+ // Template block usage:
+ await render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ expect(this.element.textContent.trim()).to.equal('template block text');
+ });
+});<% } else if (testType === 'unit') { %>import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ it('exists', function () {
+ let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
+ expect(component).to.be.ok;
+ });
+});<% } %>
diff --git a/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..29c6b4e042b
--- /dev/null
+++ b/blueprints-js/component-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,31 @@
+import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'integration') { %>
+import hbs from 'htmlbars-inline-precompile';<% } %>
+
+moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ // needs: ['component:foo', 'helper:bar'],
+ unit: true,<% } %>
+});
+
+test('it renders', function (assert) {<% if (testType === 'integration' ) { %>
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+
+ this.render(hbs`<%= selfCloseComponent(componentName) %>`);
+
+ assert.strictEqual(this.$().text().trim(), '');
+
+ // Template block usage:
+ this.render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ assert.strictEqual(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
+ // Creates the component instance
+ /*let component =*/ this.subject();
+ // Renders the component to the page
+ this.render();
+ assert.strictEqual(this.$().text().trim(), '');<% } %>
+});
diff --git a/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..0140ea71ae8
--- /dev/null
+++ b/blueprints-js/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,36 @@
+<% if (testType === 'integration') { %>import { module, test } from 'qunit';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<%= selfCloseComponent(componentName) %>`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
+ assert.ok(component);
+ });
+});<% } %>
diff --git a/blueprints/component/files/__root__/__path__/__name__.js b/blueprints-js/component/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/component/files/__root__/__path__/__name__.js
rename to blueprints-js/component/files/__root__/__path__/__name__.js
diff --git a/packages/@ember/-internals/glimmer/lib/templates/component.hbs b/blueprints-js/component/files/__root__/__templatepath__/__templatename__.hbs
similarity index 100%
rename from packages/@ember/-internals/glimmer/lib/templates/component.hbs
rename to blueprints-js/component/files/__root__/__templatepath__/__templatename__.hbs
diff --git a/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..28c0896cd35
--- /dev/null
+++ b/blueprints-js/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,16 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'ember-mocha';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest('controller:<%= dasherizedModuleName %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+ });
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let controller = this.subject();
+ expect(controller).to.be.ok;
+ });
+});
diff --git a/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..b2a49c7728d
--- /dev/null
+++ b/blueprints-js/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,18 @@
+import { expect } from 'chai';
+import { describeModule, it } from 'ember-mocha';
+
+describeModule(
+ 'controller:<%= dasherizedModuleName %>',
+ '<%= friendlyTestDescription %>',
+ {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+ },
+ function () {
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let controller = this.subject();
+ expect(controller).to.be.ok;
+ });
+ }
+);
diff --git a/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..8e0a4be04e8
--- /dev/null
+++ b/blueprints-js/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let controller = this.owner.lookup('controller:<%= controllerPathName %>');
+ expect(controller).to.be.ok;
+ });
+});
diff --git a/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..8d274ae5f3b
--- /dev/null
+++ b/blueprints-js/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,12 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('controller:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+// TODO: Replace this with your real tests.
+test('it exists', function (assert) {
+ let controller = this.subject();
+ assert.ok(controller);
+});
diff --git a/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..211e4cf497d
--- /dev/null
+++ b/blueprints-js/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:<%= controllerPathName %>');
+ assert.ok(controller);
+ });
+});
diff --git a/blueprints-js/controller/files/__root__/__path__/__name__.js b/blueprints-js/controller/files/__root__/__path__/__name__.js
new file mode 100644
index 00000000000..dcfbd50a6dc
--- /dev/null
+++ b/blueprints-js/controller/files/__root__/__path__/__name__.js
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class <%= classifiedModuleName %>Controller extends Controller {}
diff --git a/blueprints-js/helper-addon/files/__root__/__path__/__name__.js b/blueprints-js/helper-addon/files/__root__/__path__/__name__.js
new file mode 100644
index 00000000000..83aac86a6a1
--- /dev/null
+++ b/blueprints-js/helper-addon/files/__root__/__path__/__name__.js
@@ -0,0 +1 @@
+export { default } from '<%= modulePath %>';
diff --git a/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js b/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..cdb02d28391
--- /dev/null
+++ b/blueprints-js/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,26 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupComponentTest } from 'ember-mocha';
+import hbs from 'htmlbars-inline-precompile';
+
+describe('<%= friendlyTestName %>', function () {
+ setupComponentTest('<%= dasherizedModuleName %>', {
+ integration: true,
+ });
+
+ it('renders', function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+ // Template block usage:
+ // this.render(hbs`
+ // {{#<%= dasherizedModuleName %>}}
+ // template content
+ // {{/<%= dasherizedModuleName %>}}
+ // `);
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.$().text().trim()).to.equal('1234');
+ });
+});
diff --git a/blueprints-js/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js b/blueprints-js/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..843e9b35bcf
--- /dev/null
+++ b/blueprints-js/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,28 @@
+import { expect } from 'chai';
+import { describeComponent, it } from 'ember-mocha';
+import hbs from 'htmlbars-inline-precompile';
+
+describeComponent(
+ '<%= dasherizedModuleName %>',
+ 'helper:<%= dasherizedModuleName %>',
+ {
+ integration: true,
+ },
+ function () {
+ it('renders', function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+ // Template block usage:
+ // this.render(hbs`
+ // {{#<%= dasherizedModuleName %>}}
+ // template content
+ // {{/<%= dasherizedModuleName %>}}
+ // `);
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.$().text().trim()).to.equal('1234');
+ });
+ }
+);
diff --git a/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.js b/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..1d317244677
--- /dev/null
+++ b/blueprints-js/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,18 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+describe('<%= friendlyTestName %>', function () {
+ setupRenderingTest();
+
+ // TODO: Replace this with your real tests.
+ it('renders', async function () {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.element.textContent.trim()).to.equal('1234');
+ });
+});
diff --git a/blueprints-js/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js b/blueprints-js/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..45b8e177f2c
--- /dev/null
+++ b/blueprints-js/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,15 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>', {
+ integration: true,
+});
+
+// TODO: Replace this with your real tests.
+test('it renders', function (assert) {
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ assert.strictEqual(this.$().text().trim(), '1234');
+});
diff --git a/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.js b/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..a04bbbf5077
--- /dev/null
+++ b/blueprints-js/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+module('<%= friendlyTestName %>', function (hooks) {
+ setupRenderingTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it renders', async function (assert) {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ assert.dom(this.element).hasText('1234');
+ });
+});
diff --git a/blueprints-js/helper/files/__root__/helpers/__name__.js b/blueprints-js/helper/files/__root__/helpers/__name__.js
new file mode 100644
index 00000000000..786682850a6
--- /dev/null
+++ b/blueprints-js/helper/files/__root__/helpers/__name__.js
@@ -0,0 +1,5 @@
+import { helper } from '@ember/component/helper';
+
+export default helper(function <%= camelizedModuleName %>(positional /*, named*/) {
+ return positional;
+});
diff --git a/blueprints/initializer-addon/files/__root__/__path__/__name__.js b/blueprints-js/initializer-addon/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/initializer-addon/files/__root__/__path__/__name__.js
rename to blueprints-js/initializer-addon/files/__root__/__path__/__name__.js
diff --git a/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..5c3ed1a4a17
--- /dev/null
+++ b/blueprints-js/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,28 @@
+import { expect } from 'chai';
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import { run } from '@ember/runloop';
+import Application from '@ember/application';
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';\n<% } %>
+describe('<%= friendlyTestName %>', function () {
+ let application;
+
+ beforeEach(function () {
+ run(function () {
+ application = Application.create();
+ application.deferReadiness();
+ });
+ });
+
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ initialize(application);
+
+ // you would normally confirm the results of the initializer here
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..ea7700cbffd
--- /dev/null
+++ b/blueprints-js/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,31 @@
+import { expect } from 'chai';
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import Application from '@ember/application';
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+describe('<%= friendlyTestName %>', function () {
+ beforeEach(function () {
+ this.TestApplication = Application.extend();
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+ });
+
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', async function () {
+ await this.application.boot();
+
+ // you would normally confirm the results of the initializer here
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..4a3131618ea
--- /dev/null
+++ b/blueprints-js/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,25 @@
+import Application from '@ember/application';
+import { run } from '@ember/runloop';
+
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';\n<% } %>
+module('<%= friendlyTestName %>', {
+ beforeEach() {
+ run(() => {
+ this.application = Application.create();
+ this.application.deferReadiness();
+ });
+ },
+ afterEach() {
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ },
+});
+
+// TODO: Replace this with your real tests.
+test('it works', function (assert) {
+ initialize(this.application);
+
+ // you would normally confirm the results of the initializer here
+ assert.ok(true);
+});
diff --git a/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..ba8829873f8
--- /dev/null
+++ b/blueprints-js/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,37 @@
+import Application from '@ember/application';
+
+import config from '<%= modulePrefix %>/config/environment';
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+module('<%= friendlyTestName %>', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+ });
+
+ hooks.afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.application.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/blueprints-js/initializer/files/__root__/initializers/__name__.js b/blueprints-js/initializer/files/__root__/initializers/__name__.js
new file mode 100644
index 00000000000..065fae64a51
--- /dev/null
+++ b/blueprints-js/initializer/files/__root__/initializers/__name__.js
@@ -0,0 +1,5 @@
+export function initialize(application) {}
+
+export default {
+ initialize,
+};
diff --git a/blueprints/instance-initializer-addon/files/__root__/__path__/__name__.js b/blueprints-js/instance-initializer-addon/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/instance-initializer-addon/files/__root__/__path__/__name__.js
rename to blueprints-js/instance-initializer-addon/files/__root__/__path__/__name__.js
diff --git a/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..9be570cf8d0
--- /dev/null
+++ b/blueprints-js/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,30 @@
+import { expect } from 'chai';
+import { describe, it, afterEach, beforeEach } from 'mocha';
+import Application from '@ember/application';
+import { run } from '@ember/runloop';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+import destroyApp from '../../helpers/destroy-app';
+
+describe('<%= friendlyTestName %>', function () {
+ let application, appInstance;
+
+ beforeEach(function () {
+ run(function () {
+ application = Application.create();
+ appInstance = application.buildInstance();
+ });
+ });
+
+ afterEach(function () {
+ run(appInstance, 'destroy');
+ destroyApp(application);
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ initialize(appInstance);
+
+ // you would normally confirm the results of the initializer here
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..66daf8ac499
--- /dev/null
+++ b/blueprints-js/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,32 @@
+import { expect } from 'chai';
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import Application from '@ember/application';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+describe('<%= friendlyTestName %>', function () {
+ beforeEach(function () {
+ this.TestApplication = Application.extend();
+ this.TestApplication.instanceInitializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+
+ this.instance = this.application.buildInstance();
+ });
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', async function () {
+ await this.instance.boot();
+
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..9f056812709
--- /dev/null
+++ b/blueprints-js/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,26 @@
+import Application from '@ember/application';
+import { run } from '@ember/runloop';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';<% if (destroyAppExists) { %>
+import destroyApp from '../../helpers/destroy-app';<% } %>
+
+module('<%= friendlyTestName %>', {
+ beforeEach() {
+ run(() => {
+ this.application = Application.create();
+ this.appInstance = this.application.buildInstance();
+ });
+ },
+ afterEach() {
+ run(this.appInstance, 'destroy');
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ },
+});
+
+// TODO: Replace this with your real tests.
+test('it works', function (assert) {
+ initialize(this.appInstance);
+
+ // you would normally confirm the results of the initializer here
+ assert.ok(true);
+});
diff --git a/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
new file mode 100644
index 00000000000..dcb4f3f305c
--- /dev/null
+++ b/blueprints-js/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
@@ -0,0 +1,39 @@
+import Application from '@ember/application';
+
+import config from '<%= modulePrefix %>/config/environment';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+module('<%= friendlyTestName %>', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.instanceInitializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+
+ this.instance = this.application.buildInstance();
+ });
+ hooks.afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.instance.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js b/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js
new file mode 100644
index 00000000000..e0281ca4e7e
--- /dev/null
+++ b/blueprints-js/instance-initializer/files/__root__/instance-initializers/__name__.js
@@ -0,0 +1,5 @@
+export function initialize(owner) {}
+
+export default {
+ initialize,
+};
diff --git a/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js b/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..915c4202a81
--- /dev/null
+++ b/blueprints-js/mixin-test/mocha-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import EmberObject from '@ember/object';
+import <%= classifiedModuleName %>Mixin from '<%= dasherizedPackageName %>/mixins/<%= dasherizedModuleName %>';
+
+describe('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
+ let subject = <%= classifiedModuleName %>Object.create();
+ expect(subject).to.be.ok;
+ });
+});
diff --git a/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..915c4202a81
--- /dev/null
+++ b/blueprints-js/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import EmberObject from '@ember/object';
+import <%= classifiedModuleName %>Mixin from '<%= dasherizedPackageName %>/mixins/<%= dasherizedModuleName %>';
+
+describe('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
+ let subject = <%= classifiedModuleName %>Object.create();
+ expect(subject).to.be.ok;
+ });
+});
diff --git a/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js b/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..00579ff7c02
--- /dev/null
+++ b/blueprints-js/mixin-test/qunit-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,12 @@
+import EmberObject from '@ember/object';
+import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+
+module('<%= friendlyTestName %>');
+
+// TODO: Replace this with your real tests.
+test('it works', function (assert) {
+ let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
+ let subject = <%= classifiedModuleName %>Object.create();
+ assert.ok(subject);
+});
diff --git a/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..034a718d852
--- /dev/null
+++ b/blueprints-js/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,12 @@
+import EmberObject from '@ember/object';
+import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+
+module('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
+ let subject = <%= classifiedModuleName %>Object.create();
+ assert.ok(subject);
+ });
+});
diff --git a/blueprints-js/mixin/files/__root__/mixins/__name__.js b/blueprints-js/mixin/files/__root__/mixins/__name__.js
new file mode 100644
index 00000000000..9aa7bf677d8
--- /dev/null
+++ b/blueprints-js/mixin/files/__root__/mixins/__name__.js
@@ -0,0 +1,3 @@
+import Mixin from '@ember/object/mixin';
+
+export default Mixin.create({});
diff --git a/blueprints/route-addon/files/__root__/__path__/__name__.js b/blueprints-js/route-addon/files/__root__/__path__/__name__.js
similarity index 100%
rename from blueprints/route-addon/files/__root__/__path__/__name__.js
rename to blueprints-js/route-addon/files/__root__/__path__/__name__.js
diff --git a/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js b/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js
new file mode 100644
index 00000000000..2701b135456
--- /dev/null
+++ b/blueprints-js/route-addon/files/__root__/__templatepath__/__templatename__.js
@@ -0,0 +1 @@
+export { default } from '<%= templateModulePath %>';
diff --git a/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..4764e61b2e9
--- /dev/null
+++ b/blueprints-js/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,15 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'ember-mocha';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest('route:<%= moduleName %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+ });
+
+ it('exists', function () {
+ let route = this.subject();
+ expect(route).to.be.ok;
+ });
+});
diff --git a/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..e2f6ecb1547
--- /dev/null
+++ b/blueprints-js/route-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,17 @@
+import { expect } from 'chai';
+import { describeModule, it } from 'ember-mocha';
+
+describeModule(
+ 'route:<%= moduleName %>',
+ '<%= friendlyTestDescription %>',
+ {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+ },
+ function () {
+ it('exists', function () {
+ let route = this.subject();
+ expect(route).to.be.ok;
+ });
+ }
+);
diff --git a/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..8a55ca6c2f0
--- /dev/null
+++ b/blueprints-js/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,12 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ it('exists', function () {
+ let route = this.owner.lookup('route:<%= dasherizedModuleName %>');
+ expect(route).to.be.ok;
+ });
+});
diff --git a/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..44232623e38
--- /dev/null
+++ b/blueprints-js/route-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,11 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:<%= moduleName %>', '<%= friendlyTestDescription %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['controller:foo']
+});
+
+test('it exists', function (assert) {
+ let route = this.subject();
+ assert.ok(route);
+});
diff --git a/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..942fd41cc9c
--- /dev/null
+++ b/blueprints-js/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:<%= moduleName %>');
+ assert.ok(route);
+ });
+});
diff --git a/blueprints-js/route/files/__root__/__path__/__name__.js b/blueprints-js/route/files/__root__/__path__/__name__.js
new file mode 100644
index 00000000000..aeb39c6b91b
--- /dev/null
+++ b/blueprints-js/route/files/__root__/__path__/__name__.js
@@ -0,0 +1,9 @@
+import Route from '@ember/routing/route';
+
+export default class <%= classifiedModuleName %>Route extends Route {<% if (hasDynamicSegment) {%>
+ model(params) {
+ // This route was generated with a dynamic segment. Implement data loading
+ // based on that dynamic segment here in the model hook.
+ return params;
+ }
+<%}%>}
diff --git a/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs b/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs
new file mode 100644
index 00000000000..9857cee0c36
--- /dev/null
+++ b/blueprints-js/route/files/__root__/__templatepath__/__templatename__.hbs
@@ -0,0 +1,2 @@
+<% if (addTitle) {%>{{page-title "<%= routeName %>"}}
+<%}%>{{outlet}}
\ No newline at end of file
diff --git a/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..dde1fd8b11c
--- /dev/null
+++ b/blueprints-js/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,16 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'ember-mocha';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest('service:<%= dasherizedModuleName %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['service:foo']
+ });
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let service = this.subject();
+ expect(service).to.be.ok;
+ });
+});
diff --git a/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..2954042d0d0
--- /dev/null
+++ b/blueprints-js/service-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,18 @@
+import { expect } from 'chai';
+import { describeModule, it } from 'ember-mocha';
+
+describeModule(
+ 'service:<%= dasherizedModuleName %>',
+ '<%= friendlyTestDescription %>',
+ {
+ // Specify the other units that are required for this test.
+ // needs: ['service:foo']
+ },
+ function () {
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let service = this.subject();
+ expect(service).to.be.ok;
+ });
+ }
+);
diff --git a/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..2124d8d45fa
--- /dev/null
+++ b/blueprints-js/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
+ expect(service).to.be.ok;
+ });
+});
diff --git a/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..1f42bc8820f
--- /dev/null
+++ b/blueprints-js/service-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,12 @@
+import { moduleFor, test } from 'ember-qunit';
+
+moduleFor('service:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
+ // Specify the other units that are required for this test.
+ // needs: ['service:foo']
+});
+
+// TODO: Replace this with your real tests.
+test('it exists', function (assert) {
+ let service = this.subject();
+ assert.ok(service);
+});
diff --git a/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
new file mode 100644
index 00000000000..14ec42e38ad
--- /dev/null
+++ b/blueprints-js/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
+ assert.ok(service);
+ });
+});
diff --git a/blueprints-js/service/files/__root__/__path__/__name__.js b/blueprints-js/service/files/__root__/__path__/__name__.js
new file mode 100644
index 00000000000..6f7a5e9baa4
--- /dev/null
+++ b/blueprints-js/service/files/__root__/__path__/__name__.js
@@ -0,0 +1,3 @@
+import Service from '@ember/service';
+
+export default class <%= classifiedModuleName %>Service extends Service {}
diff --git a/blueprints-js/template/files/__root__/__path__/__name__.hbs b/blueprints-js/template/files/__root__/__path__/__name__.hbs
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js b/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..8d06bcc0413
--- /dev/null
+++ b/blueprints-js/util-test/mocha-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,11 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';
+
+describe('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ let result = <%= camelizedModuleName %>();
+ expect(result).to.be.ok;
+ });
+});
diff --git a/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..8d06bcc0413
--- /dev/null
+++ b/blueprints-js/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,11 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';
+
+describe('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ let result = <%= camelizedModuleName %>();
+ expect(result).to.be.ok;
+ });
+});
diff --git a/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js b/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..2a10306510e
--- /dev/null
+++ b/blueprints-js/util-test/qunit-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,10 @@
+import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+
+module('<%= friendlyTestName %>');
+
+// TODO: Replace this with your real tests.
+test('it works', function (assert) {
+ let result = <%= camelizedModuleName %>();
+ assert.ok(result);
+});
diff --git a/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
new file mode 100644
index 00000000000..0278e54bdfb
--- /dev/null
+++ b/blueprints-js/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -0,0 +1,10 @@
+import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+
+module('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let result = <%= camelizedModuleName %>();
+ assert.ok(result);
+ });
+});
diff --git a/blueprints/util/files/__root__/utils/__name__.js b/blueprints-js/util/files/__root__/utils/__name__.js
similarity index 100%
rename from blueprints/util/files/__root__/utils/__name__.js
rename to blueprints-js/util/files/__root__/utils/__name__.js
diff --git a/blueprints/-addon-import.js b/blueprints/-addon-import.js
index dc54a2d22d5..fa40870e6f4 100644
--- a/blueprints/-addon-import.js
+++ b/blueprints/-addon-import.js
@@ -4,18 +4,27 @@ const stringUtil = require('ember-cli-string-utils');
const path = require('path');
const inflector = require('inflection');
+const maybePolyfillTypeScriptBlueprints = require('./-maybe-polyfill-typescript-blueprints');
+
module.exports = {
description: 'Generates an import wrapper.',
- fileMapTokens: function() {
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
return {
- __name__: function(options) {
+ __name__: function (options) {
return options.dasherizedModuleName;
},
- __path__: function(options) {
+ __path__: function (options) {
return inflector.pluralize(options.locals.blueprintName);
},
- __root__: function(options) {
+ __root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
@@ -24,7 +33,7 @@ module.exports = {
};
},
- locals: function(options) {
+ locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
diff --git a/blueprints/-maybe-polyfill-typescript-blueprints.js b/blueprints/-maybe-polyfill-typescript-blueprints.js
new file mode 100644
index 00000000000..93508ebb8c6
--- /dev/null
+++ b/blueprints/-maybe-polyfill-typescript-blueprints.js
@@ -0,0 +1,19 @@
+const typescriptBlueprintPolyfill = require('ember-cli-typescript-blueprint-polyfill');
+const EMBER_TYPESCRIPT_BLUEPRINTS = true;
+
+function canEmitTypeScript() {
+ return 'EMBER_TYPESCRIPT_BLUEPRINTS' in process.env
+ ? process.env.EMBER_TYPESCRIPT_BLUEPRINTS === 'true'
+ : EMBER_TYPESCRIPT_BLUEPRINTS;
+}
+
+module.exports = function (context) {
+ let canUseTypeScript = canEmitTypeScript();
+ if (canUseTypeScript) {
+ typescriptBlueprintPolyfill(context);
+ } else {
+ // Use the plain old JS templates from before
+ context.path = context.path.replace('blueprints', 'blueprints-js');
+ }
+ return canUseTypeScript;
+};
diff --git a/blueprints/-utils.js b/blueprints/-utils.js
new file mode 100644
index 00000000000..37f7754f770
--- /dev/null
+++ b/blueprints/-utils.js
@@ -0,0 +1,9 @@
+const { dasherize } = require('ember-cli-string-utils');
+
+function modulePrefixForProject(project) {
+ return dasherize(project.config().modulePrefix);
+}
+
+module.exports = {
+ modulePrefixForProject,
+};
diff --git a/blueprints/acceptance-test/index.js b/blueprints/acceptance-test/index.js
index 2a305ae25d0..0f70417307e 100644
--- a/blueprints/acceptance-test/index.js
+++ b/blueprints/acceptance-test/index.js
@@ -5,12 +5,21 @@ const path = require('path');
const pathUtil = require('ember-cli-path-utils');
const stringUtils = require('ember-cli-string-utils');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
module.exports = useTestFrameworkDetector({
description: 'Generates an acceptance test for a feature.',
- locals: function(options) {
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ locals: function (options) {
let testFolderRoot = stringUtils.dasherize(options.project.name());
if (options.project.isEmberCLIAddon()) {
@@ -27,7 +36,8 @@ module.exports = useTestFrameworkDetector({
].join(' | ');
return {
- testFolderRoot: testFolderRoot,
+ modulePrefix: modulePrefixForProject(options.project),
+ testFolderRoot,
friendlyTestName,
destroyAppExists,
};
diff --git a/blueprints/acceptance-test/mocha-files/tests/acceptance/__name__-test.js b/blueprints/acceptance-test/mocha-files/tests/acceptance/__name__-test.js
index 2700039e658..b6038d964c8 100644
--- a/blueprints/acceptance-test/mocha-files/tests/acceptance/__name__-test.js
+++ b/blueprints/acceptance-test/mocha-files/tests/acceptance/__name__-test.js
@@ -3,18 +3,18 @@ import { expect } from 'chai';
import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
-describe('<%= friendlyTestName %>', function() {
+describe('<%= friendlyTestName %>', function () {
let application;
- beforeEach(function() {
+ beforeEach(function () {
application = startApp();
});
- afterEach(function() {
+ afterEach(function () {
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
});
- it('can visit /<%= dasherizedModuleName %>', function() {
+ it('can visit /<%= dasherizedModuleName %>', function () {
visit('/<%= dasherizedModuleName %>');
return andThen(() => {
diff --git a/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js b/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js
deleted file mode 100644
index e26de7ca265..00000000000
--- a/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { describe, it } from 'mocha';
-import { expect } from 'chai';
-import { setupApplicationTest } from 'ember-mocha';
-import { visit, currentURL } from '@ember/test-helpers';
-
-describe('<%= friendlyTestName %>', function() {
- setupApplicationTest();
-
- it('can visit /<%= dasherizedModuleName %>', async function() {
- await visit('/<%= dasherizedModuleName %>');
- expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
- });
-});
diff --git a/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts b/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts
new file mode 100644
index 00000000000..9f28e50b894
--- /dev/null
+++ b/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts
@@ -0,0 +1,13 @@
+import { describe, it } from 'mocha';
+import { expect } from 'chai';
+import { setupApplicationTest } from '<%= modulePrefix %>/tests/helpers';
+import { visit, currentURL } from '@ember/test-helpers';
+
+describe('<%= friendlyTestName %>', function () {
+ setupApplicationTest();
+
+ it('can visit /<%= dasherizedModuleName %>', async function () {
+ await visit('/<%= dasherizedModuleName %>');
+ expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
+ });
+});
diff --git a/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js b/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js
index abbcab2497f..35b4c18f65b 100644
--- a/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js
+++ b/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js
@@ -3,10 +3,10 @@ import moduleForAcceptance from '<%= testFolderRoot %>/tests/helpers/module-for-
moduleForAcceptance('<%= friendlyTestName %>');
-test('visiting /<%= dasherizedModuleName %>', function(assert) {
+test('visiting /<%= dasherizedModuleName %>', function (assert) {
visit('/<%= dasherizedModuleName %>');
- andThen(function() {
- assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
+ andThen(function () {
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
});
});
diff --git a/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js b/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js
deleted file mode 100644
index b2f9e80bd91..00000000000
--- a/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { module, test } from 'qunit';
-import { visit, currentURL } from '@ember/test-helpers';
-import { setupApplicationTest } from 'ember-qunit';
-
-module('<%= friendlyTestName %>', function(hooks) {
- setupApplicationTest(hooks);
-
- test('visiting /<%= dasherizedModuleName %>', async function(assert) {
- await visit('/<%= dasherizedModuleName %>');
-
- assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
- });
-});
diff --git a/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts b/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts
new file mode 100644
index 00000000000..07ae1fa1048
--- /dev/null
+++ b/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { visit, currentURL } from '@ember/test-helpers';
+import { setupApplicationTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestName %>', function (hooks) {
+ setupApplicationTest(hooks);
+
+ test('visiting /<%= dasherizedModuleName %>', async function (assert) {
+ await visit('/<%= dasherizedModuleName %>');
+
+ assert.strictEqual(currentURL(), '/<%= dasherizedModuleName %>');
+ });
+});
diff --git a/blueprints/component-class-addon/files/__root__/__path__/__name__.js b/blueprints/component-addon/files/__root__/__path__/__name__.ts
similarity index 100%
rename from blueprints/component-class-addon/files/__root__/__path__/__name__.js
rename to blueprints/component-addon/files/__root__/__path__/__name__.ts
diff --git a/blueprints/component-addon/index.js b/blueprints/component-addon/index.js
index 046537deb94..1550b25c886 100644
--- a/blueprints/component-addon/index.js
+++ b/blueprints/component-addon/index.js
@@ -4,38 +4,46 @@ const path = require('path');
const stringUtil = require('ember-cli-string-utils');
const getPathOption = require('ember-cli-get-component-path-option');
const normalizeEntityName = require('ember-cli-normalize-entity-name');
-const useEditionDetector = require('../edition-detector');
-module.exports = useEditionDetector({
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
+module.exports = {
description: 'Generates a component.',
- fileMapTokens: function() {
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
return {
- __path__: function(options) {
+ __path__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'components';
},
- __name__: function(options) {
+ __name__: function (options) {
if (options.pod) {
return 'component';
}
return options.dasherizedModuleName;
},
- __root__: function(options) {
+ __root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
return 'app';
},
- __templatepath__: function(options) {
+ __templatepath__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'templates/components';
},
- __templatename__: function(options) {
+ __templatename__: function (options) {
if (options.pod) {
return 'template';
}
@@ -44,11 +52,11 @@ module.exports = useEditionDetector({
};
},
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return normalizeEntityName(entityName);
},
- locals: function(options) {
+ locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
@@ -73,4 +81,4 @@ module.exports = useEditionDetector({
path: getPathOption(options),
};
},
-});
+};
diff --git a/blueprints/component-class-addon/native-files/__root__/__path__/__name__.js b/blueprints/component-class-addon/files/__root__/__path__/__name__.ts
similarity index 100%
rename from blueprints/component-class-addon/native-files/__root__/__path__/__name__.js
rename to blueprints/component-class-addon/files/__root__/__path__/__name__.ts
diff --git a/blueprints/component-class-addon/index.js b/blueprints/component-class-addon/index.js
index 59a10cc4499..16df092bdb0 100644
--- a/blueprints/component-class-addon/index.js
+++ b/blueprints/component-class-addon/index.js
@@ -4,26 +4,34 @@ const path = require('path');
const stringUtil = require('ember-cli-string-utils');
const getPathOption = require('ember-cli-get-component-path-option');
const normalizeEntityName = require('ember-cli-normalize-entity-name');
-const useEditionDetector = require('../edition-detector');
-module.exports = useEditionDetector({
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
+module.exports = {
description: 'Generates a component class.',
- fileMapTokens: function() {
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
return {
- __path__: function(options) {
+ __path__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.locals.path, options.dasherizedModuleName);
}
return 'components';
},
- __name__: function(options) {
+ __name__: function (options) {
if (options.pod) {
return 'component';
}
return options.dasherizedModuleName;
},
- __root__: function(options) {
+ __root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
@@ -32,11 +40,11 @@ module.exports = useEditionDetector({
};
},
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return normalizeEntityName(entityName);
},
- locals: function(options) {
+ locals: function (options) {
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
@@ -51,4 +59,4 @@ module.exports = useEditionDetector({
path: getPathOption(options),
};
},
-});
+};
diff --git a/blueprints/component-class/files/__root__/__path__/__name__.ts b/blueprints/component-class/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..777e6155290
--- /dev/null
+++ b/blueprints/component-class/files/__root__/__path__/__name__.ts
@@ -0,0 +1,3 @@
+<%= importComponent %>
+<%= importTemplate %>
+export default <%= defaultExport %>
diff --git a/blueprints/component-class/index.js b/blueprints/component-class/index.js
index cb970dbb030..1c6f463b7cc 100644
--- a/blueprints/component-class/index.js
+++ b/blueprints/component-class/index.js
@@ -9,6 +9,8 @@ const normalizeEntityName = require('ember-cli-normalize-entity-name');
const { EOL } = require('os');
const { has } = require('@ember/edition-utils');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
const OCTANE = has('octane');
// TODO: this should be reading from the @ember/canary-features module
@@ -20,6 +22,8 @@ const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = true;
module.exports = {
description: 'Generates a component class.',
+ shouldTransformTypeScript: true,
+
availableOptions: [
{
name: 'path',
@@ -47,9 +51,10 @@ module.exports = {
init() {
this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
let isOctane = has('octane');
- this.availableOptions.forEach(option => {
+ this.availableOptions.forEach((option) => {
if (option.name === 'component-class') {
if (isOctane) {
option.default = '@glimmer/component';
@@ -151,12 +156,12 @@ module.exports = {
importTemplate = `import layout from '${templatePath}';${EOL}`;
defaultExport = `Component.extend({${EOL} layout${EOL}});`;
} else {
- defaultExport = `Component.extend({${EOL}});`;
+ defaultExport = `Component.extend({});`;
}
break;
case '@glimmer/component':
importComponent = `import Component from '@glimmer/component';`;
- defaultExport = `class ${classifiedModuleName}Component extends Component {\n}`;
+ defaultExport = `class ${classifiedModuleName}Component extends Component {}`;
break;
case '@ember/component/template-only':
importComponent = `import templateOnly from '@ember/component/template-only';`;
diff --git a/blueprints/component-test/index.js b/blueprints/component-test/index.js
index 79ab3acd454..1e89db6e6b0 100644
--- a/blueprints/component-test/index.js
+++ b/blueprints/component-test/index.js
@@ -6,16 +6,25 @@ const isPackageMissing = require('ember-cli-is-package-missing');
const getPathOption = require('ember-cli-get-component-path-option');
const semver = require('semver');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
function invocationFor(options) {
let parts = options.entity.name.split('/');
- return parts.map(p => stringUtil.classify(p)).join('::');
+ return parts.map((p) => stringUtil.classify(p)).join('::');
}
module.exports = useTestFrameworkDetector({
description: 'Generates a component integration or unit test.',
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
availableOptions: [
{
name: 'test-type',
@@ -30,7 +39,7 @@ module.exports = useTestFrameworkDetector({
},
],
- fileMapTokens: function() {
+ fileMapTokens: function () {
return {
__root__() {
return 'tests';
@@ -47,7 +56,7 @@ module.exports = useTestFrameworkDetector({
};
},
- locals: function(options) {
+ locals: function (options) {
let dasherizedModuleName = stringUtil.dasherize(options.entity.name);
let componentPathName = dasherizedModuleName;
let testType = options.testType || 'integration';
@@ -68,11 +77,12 @@ module.exports = useTestFrameworkDetector({
let templateInvocation = invocationFor(options);
let componentName = templateInvocation;
- let openComponent = descriptor => `<${descriptor}>`;
- let closeComponent = descriptor => `${descriptor}>`;
- let selfCloseComponent = descriptor => `<${descriptor} />`;
+ let openComponent = (descriptor) => `<${descriptor}>`;
+ let closeComponent = (descriptor) => `${descriptor}>`;
+ let selfCloseComponent = (descriptor) => `<${descriptor} />`;
return {
+ modulePrefix: modulePrefixForProject(options.project),
path: getPathOption(options),
testType: testType,
componentName,
@@ -87,7 +97,7 @@ module.exports = useTestFrameworkDetector({
},
_useNamedHbsImport() {
- let htmlbarsAddon = this.project.addons.find(a => a.name === 'ember-cli-htmlbars');
+ let htmlbarsAddon = this.project.addons.find((a) => a.name === 'ember-cli-htmlbars');
if (htmlbarsAddon && semver.gte(htmlbarsAddon.pkg.version, '4.0.0-alpha.1')) {
return true;
@@ -96,7 +106,7 @@ module.exports = useTestFrameworkDetector({
return false;
},
- afterInstall: function(options) {
+ afterInstall: function (options) {
if (
!options.dryRun &&
options.testType === 'integration' &&
diff --git a/blueprints/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
index 52200d594e5..f73315461e6 100644
--- a/blueprints/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -3,14 +3,14 @@ import { describe, it } from 'mocha';
import { setupComponentTest } from 'ember-mocha';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
-describe('<%= friendlyTestDescription %>', function() {
+describe('<%= friendlyTestDescription %>', function () {
setupComponentTest('<%= componentPathName %>', {
- <% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true<% } %>
+ unit: true,<% } %>
});
- it('renders', function() {
+ it('renders', function () {
<% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
diff --git a/blueprints/component-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints/component-test/mocha-files/__root__/__testType__/__path__/__test__.js
index 7dafcd4505e..765ad7f3310 100644
--- a/blueprints/component-test/mocha-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/component-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -2,14 +2,16 @@ import { expect } from 'chai';
import { describeComponent, it } from 'ember-mocha';<% if (testType === 'integration') { %>
import hbs from 'htmlbars-inline-precompile';<% } %>
-describeComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>',
+describeComponent(
+ '<%= componentPathName %>',
+ '<%= friendlyTestDescription %>',
{
- <% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true<% } %>
+ unit: true,<% } %>
},
- function() {
- it('renders', function() {
+ function () {
+ it('renders', function () {
<% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
diff --git a/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index 68422cb9543..00000000000
--- a/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,38 +0,0 @@
-<% if (testType === 'integration') { %>import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { setupRenderingTest } from 'ember-mocha';
-import { render } from '@ember/test-helpers';
-<%= hbsImportStatement %>
-
-describe('<%= friendlyTestDescription %>', function() {
- setupRenderingTest();
-
- it('renders', async function() {
- // Set any properties with this.set('myProperty', 'value');
- // Handle any actions with this.set('myAction', function(val) { ... });
-
- await render(hbs`<%= selfCloseComponent(componentName) %>`);
-
- expect(this.element.textContent.trim()).to.equal('');
-
- // Template block usage:
- await render(hbs`
- <%= openComponent(componentName) %>
- template block text
- <%= closeComponent(componentName) %>
- `);
-
- expect(this.element.textContent.trim()).to.equal('template block text');
- });
-});<% } else if (testType === 'unit') { %>import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
-
-describe('<%= friendlyTestDescription %>', function() {
- setupTest();
-
- it('exists', function() {
- let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
- expect(component).to.be.ok;
- });
-});<% } %>
diff --git a/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..09e004001b3
--- /dev/null
+++ b/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,38 @@
+<% if (testType === 'integration') { %>import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupRenderingTest();
+
+ it('renders', async function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<%= selfCloseComponent(componentName) %>`);
+
+ expect(this.element.textContent.trim()).to.equal('');
+
+ // Template block usage:
+ await render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ expect(this.element.textContent.trim()).to.equal('template block text');
+ });
+});<% } else if (testType === 'unit') { %>import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ it('exists', function () {
+ let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
+ expect(component).to.be.ok;
+ });
+});<% } %>
diff --git a/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js
index d451eaf7c41..29c6b4e042b 100644
--- a/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -2,18 +2,18 @@ import { moduleForComponent, test } from 'ember-qunit';<% if (testType === 'inte
import hbs from 'htmlbars-inline-precompile';<% } %>
moduleForComponent('<%= componentPathName %>', '<%= friendlyTestDescription %>', {
- <% if (testType === 'integration' ) { %>integration: true<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
+ <% if (testType === 'integration' ) { %>integration: true,<% } else if(testType === 'unit') { %>// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true<% } %>
+ unit: true,<% } %>
});
-test('it renders', function(assert) {
- <% if (testType === 'integration' ) { %>// Set any properties with this.set('myProperty', 'value');
+test('it renders', function (assert) {<% if (testType === 'integration' ) { %>
+ // Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`<%= selfCloseComponent(componentName) %>`);
- assert.equal(this.$().text().trim(), '');
+ assert.strictEqual(this.$().text().trim(), '');
// Template block usage:
this.render(hbs`
@@ -22,10 +22,10 @@ test('it renders', function(assert) {
<%= closeComponent(componentName) %>
`);
- assert.equal(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
+ assert.strictEqual(this.$().text().trim(), 'template block text');<% } else if(testType === 'unit') { %>
// Creates the component instance
/*let component =*/ this.subject();
// Renders the component to the page
this.render();
- assert.equal(this.$().text().trim(), '');<% } %>
+ assert.strictEqual(this.$().text().trim(), '');<% } %>
});
diff --git a/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index e7fcd4d3f08..00000000000
--- a/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,36 +0,0 @@
-<% if (testType === 'integration') { %>import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
-<%= hbsImportStatement %>
-
-module('<%= friendlyTestDescription %>', function(hooks) {
- setupRenderingTest(hooks);
-
- test('it renders', async function(assert) {
- // Set any properties with this.set('myProperty', 'value');
- // Handle any actions with this.set('myAction', function(val) { ... });
-
- await render(hbs`<%= selfCloseComponent(componentName) %>`);
-
- assert.equal(this.element.textContent.trim(), '');
-
- // Template block usage:
- await render(hbs`
- <%= openComponent(componentName) %>
- template block text
- <%= closeComponent(componentName) %>
- `);
-
- assert.equal(this.element.textContent.trim(), 'template block text');
- });
-});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('<%= friendlyTestDescription %>', function(hooks) {
- setupTest(hooks);
-
- test('it exists', function(assert) {
- let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
- assert.ok(component);
- });
-});<% } %>
diff --git a/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..d2d4e87d1a4
--- /dev/null
+++ b/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,36 @@
+<% if (testType === 'integration') { %>import { module, test } from 'qunit';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs`<%= selfCloseComponent(componentName) %>`);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+ <%= openComponent(componentName) %>
+ template block text
+ <%= closeComponent(componentName) %>
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
+ assert.ok(component);
+ });
+}); <% } %>
diff --git a/blueprints/component/files/__root__/__path__/__name__.ts b/blueprints/component/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..3ddc45ea7ba
--- /dev/null
+++ b/blueprints/component/files/__root__/__path__/__name__.ts
@@ -0,0 +1,4 @@
+<%= importComponent %>
+<%= importTemplate %>
+<%= componentSignature %>
+export default <%= defaultExport %>
diff --git a/blueprints/component/index.js b/blueprints/component/index.js
index 4a3e4a2563b..fe81e2e7653 100644
--- a/blueprints/component/index.js
+++ b/blueprints/component/index.js
@@ -10,6 +10,8 @@ const normalizeEntityName = require('ember-cli-normalize-entity-name');
const { EOL } = require('os');
const { has } = require('@ember/edition-utils');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
const OCTANE = has('octane');
// TODO: this should be reading from the @ember/canary-features module
@@ -21,6 +23,8 @@ const EMBER_GLIMMER_SET_COMPONENT_TEMPLATE = true;
module.exports = {
description: 'Generates a component.',
+ shouldTransformTypeScript: true,
+
availableOptions: [
{
name: 'path',
@@ -49,11 +53,20 @@ module.exports = {
},
],
+ /**
+ Flag to let us correctly handle the case where we are running against a
+ version of Ember CLI which does not support TS-based emit, and where we
+ therefore *must* not emit a `defaultExport` local which includes a type
+ parameter in the exported function call or class definition.
+ */
+ _isUsingTS: false,
+
init() {
this._super && this._super.init.apply(this, arguments);
+ this._isUsingTS = maybePolyfillTypeScriptBlueprints(this);
let isOctane = has('octane');
- this.availableOptions.forEach(option => {
+ this.availableOptions.forEach((option) => {
if (option.name === 'component-class') {
if (isOctane) {
option.default = '--no-component-class';
@@ -121,7 +134,7 @@ module.exports = {
afterInstall(options) {
this._super.afterInstall.apply(this, arguments);
- this.skippedJsFiles.forEach(file => {
+ this.skippedJsFiles.forEach((file) => {
let mapped = this.mapFile(file, this.savedLocals);
this.ui.writeLine(` ${chalk.yellow('skip')} ${mapped}`);
});
@@ -202,8 +215,8 @@ module.exports = {
let files = this._super.files.apply(this, arguments);
if (this.EMBER_GLIMMER_SET_COMPONENT_TEMPLATE && this.options.componentClass === '') {
- files = files.filter(file => {
- if (file.endsWith('.js')) {
+ files = files.filter((file) => {
+ if (file.endsWith('.js') || file.endsWith('.ts')) {
this.skippedJsFiles.add(file);
return false;
} else {
@@ -222,15 +235,8 @@ module.exports = {
},
locals(options) {
- let sanitizedModuleName = options.entity.name.replace(/\//g, '-');
- let classifiedModuleName = stringUtil.classify(sanitizedModuleName);
-
- let templatePath = '';
- let importComponent = '';
- let importTemplate = '';
- let defaultExport = '';
-
// if we're in an addon, build import statement
+ let templatePath = '';
if (options.project.isEmberCLIAddon() || (options.inRepoAddon && !options.inDummy)) {
if (options.pod) {
templatePath = './template';
@@ -246,6 +252,14 @@ module.exports = {
? options.componentClass
: '@ember/component';
+ let sanitizedModuleName = options.entity.name.replace(/\//g, '-');
+ let classifiedModuleName = stringUtil.classify(sanitizedModuleName);
+
+ let importComponent = '';
+ let importTemplate = '';
+ let defaultExport = '';
+ let componentSignature = '';
+
switch (componentClass) {
case '@ember/component':
importComponent = `import Component from '@ember/component';`;
@@ -253,25 +267,58 @@ module.exports = {
importTemplate = `import layout from '${templatePath}';${EOL}`;
defaultExport = `Component.extend({${EOL} layout${EOL}});`;
} else {
- defaultExport = `Component.extend({${EOL}});`;
+ defaultExport = `Component.extend({});`;
}
break;
case '@glimmer/component':
importComponent = `import Component from '@glimmer/component';`;
- defaultExport = `class ${classifiedModuleName}Component extends Component {${EOL}}`;
+ if (this._isUsingTS) {
+ componentSignature = signatureFor(classifiedModuleName);
+ defaultExport = `class ${classifiedModuleName}Component extends Component<${classifiedModuleName}Signature> {}`;
+ } else {
+ defaultExport = `class ${classifiedModuleName}Component extends Component {}`;
+ }
break;
case '@ember/component/template-only':
importComponent = `import templateOnly from '@ember/component/template-only';`;
- defaultExport = `templateOnly();`;
+ if (this._isUsingTS) {
+ componentSignature = signatureFor(classifiedModuleName);
+ defaultExport = `templateOnly<${classifiedModuleName}Signature>();`;
+ } else {
+ defaultExport = `templateOnly();`;
+ }
break;
}
return {
importTemplate,
importComponent,
+ componentSignature,
defaultExport,
path: getPathOption(options),
componentClass: options.componentClass,
};
},
};
+
+function signatureFor(classifiedModuleName) {
+ let args = ` // The arguments accepted by the component${EOL} Args: {};`;
+
+ let blocks =
+ ` // Any blocks yielded by the component${EOL}` +
+ ` Blocks: {${EOL}` +
+ ` default: []${EOL}` +
+ ` };`;
+
+ let element =
+ ` // The element to which \`...attributes\` is applied in the component template${EOL}` +
+ ` Element: null;`;
+
+ return (
+ `interface ${classifiedModuleName}Signature {${EOL}` +
+ `${args}${EOL}` +
+ `${blocks}${EOL}` +
+ `${element}${EOL}` +
+ `}${EOL}`
+ );
+}
diff --git a/blueprints/controller-test/index.js b/blueprints/controller-test/index.js
index 90dd95340c6..3d2b1f29f9f 100644
--- a/blueprints/controller-test/index.js
+++ b/blueprints/controller-test/index.js
@@ -3,54 +3,45 @@
const stringUtil = require('ember-cli-string-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
const path = require('path');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
+
module.exports = useTestFrameworkDetector({
description: 'Generates a controller unit test.',
- locals: function(options) {
+
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ locals: function (options) {
let dasherizedModuleName = stringUtil.dasherize(options.entity.name);
let controllerPathName = dasherizedModuleName;
return {
+ modulePrefix: modulePrefixForProject(options.project),
controllerPathName: controllerPathName,
friendlyTestDescription: ['Unit', 'Controller', dasherizedModuleName].join(' | '),
};
},
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __test__() {
- return 'controller-test';
- },
- __testType__() {
- return '';
- },
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
- return 'src';
- },
- __path__(options) {
- return path.join('ui', 'routes', options.dasherizedModuleName);
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return 'unit';
- },
- __path__(options) {
- if (options.pod) {
- return path.join(options.podPath, options.dasherizedModuleName);
- }
- return 'controllers';
- },
- };
- }
+ fileMapTokens: function () {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'unit';
+ },
+ __path__(options) {
+ if (options.pod) {
+ return path.join(options.podPath, options.dasherizedModuleName);
+ }
+ return 'controllers';
+ },
+ };
},
});
diff --git a/blueprints/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
index 8be2a4a01b5..28c0896cd35 100644
--- a/blueprints/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/controller-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('<%= friendlyTestDescription %>', function() {
+describe('<%= friendlyTestDescription %>', function () {
setupTest('controller:<%= dasherizedModuleName %>', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/blueprints/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js
index 63e225f6dc8..b2a49c7728d 100644
--- a/blueprints/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/controller-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('controller:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>',
+describeModule(
+ 'controller:<%= dasherizedModuleName %>',
+ '<%= friendlyTestDescription %>',
{
// Specify the other units that are required for this test.
// needs: ['controller:foo']
},
- function() {
+ function () {
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index 79dade91ef5..00000000000
--- a/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
-
-describe('<%= friendlyTestDescription %>', function() {
- setupTest();
-
- // TODO: Replace this with your real tests.
- it('exists', function() {
- let controller = this.owner.lookup('controller:<%= controllerPathName %>');
- expect(controller).to.be.ok;
- });
-});
diff --git a/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..8e0a4be04e8
--- /dev/null
+++ b/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let controller = this.owner.lookup('controller:<%= controllerPathName %>');
+ expect(controller).to.be.ok;
+ });
+});
diff --git a/blueprints/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js
index 25a2604730a..8d274ae5f3b 100644
--- a/blueprints/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/controller-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -6,7 +6,7 @@ moduleFor('controller:<%= dasherizedModuleName %>', '<%= friendlyTestDescription
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let controller = this.subject();
assert.ok(controller);
});
diff --git a/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index 4213416e7b6..00000000000
--- a/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('<%= friendlyTestDescription %>', function(hooks) {
- setupTest(hooks);
-
- // TODO: Replace this with your real tests.
- test('it exists', function(assert) {
- let controller = this.owner.lookup('controller:<%= controllerPathName %>');
- assert.ok(controller);
- });
-});
diff --git a/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..211e4cf497d
--- /dev/null
+++ b/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:<%= controllerPathName %>');
+ assert.ok(controller);
+ });
+});
diff --git a/blueprints/controller/files/__root__/__path__/__name__.js b/blueprints/controller/files/__root__/__path__/__name__.js
deleted file mode 100644
index d630f313455..00000000000
--- a/blueprints/controller/files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Controller from '@ember/controller';
-
-export default Controller.extend({
-});
diff --git a/blueprints/controller/files/__root__/__path__/__name__.ts b/blueprints/controller/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..dcfbd50a6dc
--- /dev/null
+++ b/blueprints/controller/files/__root__/__path__/__name__.ts
@@ -0,0 +1,3 @@
+import Controller from '@ember/controller';
+
+export default class <%= classifiedModuleName %>Controller extends Controller {}
diff --git a/blueprints/controller/index.js b/blueprints/controller/index.js
index 6a4b8d1e9b6..5a3280004ad 100644
--- a/blueprints/controller/index.js
+++ b/blueprints/controller/index.js
@@ -1,33 +1,18 @@
'use strict';
-const useEditionDetector = require('../edition-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
-const path = require('path');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
-module.exports = useEditionDetector({
+module.exports = {
description: 'Generates a controller.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
- return 'src';
- },
- __path__(options) {
- return path.join('ui', 'routes', options.dasherizedModuleName);
- },
- __name__() {
- return 'controller';
- },
- };
- }
+
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
- normalizeEntityName: function(entityName) {
+
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
},
-});
+};
diff --git a/blueprints/controller/native-files/__root__/__path__/__name__.js b/blueprints/controller/native-files/__root__/__path__/__name__.js
deleted file mode 100644
index f4f0e1b5433..00000000000
--- a/blueprints/controller/native-files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Controller from '@ember/controller';
-
-export default class <%= classifiedModuleName %>Controller extends Controller {
-}
diff --git a/blueprints/edition-detector.js b/blueprints/edition-detector.js
deleted file mode 100644
index 6fb1115c23b..00000000000
--- a/blueprints/edition-detector.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-const { has } = require('@ember/edition-utils');
-const path = require('path');
-
-module.exports = function(blueprint) {
- blueprint.filesPath = function() {
- let rootPath = has('octane') ? 'native-files' : 'files';
- return path.join(this.path, rootPath);
- };
-
- return blueprint;
-};
diff --git a/blueprints/helper-addon/files/__root__/__path__/__name__.js b/blueprints/helper-addon/files/__root__/__path__/__name__.js
deleted file mode 100644
index a34b84552a1..00000000000
--- a/blueprints/helper-addon/files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1 +0,0 @@
-export { default, <%= camelizedModuleName %> } from '<%= modulePath %>';
diff --git a/blueprints/helper-addon/files/__root__/__path__/__name__.ts b/blueprints/helper-addon/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..83aac86a6a1
--- /dev/null
+++ b/blueprints/helper-addon/files/__root__/__path__/__name__.ts
@@ -0,0 +1 @@
+export { default } from '<%= modulePath %>';
diff --git a/blueprints/helper-test/index.js b/blueprints/helper-test/index.js
index 8d042b7e073..8456913d99a 100644
--- a/blueprints/helper-test/index.js
+++ b/blueprints/helper-test/index.js
@@ -1,96 +1,50 @@
'use strict';
-const stringUtils = require('ember-cli-string-utils');
const isPackageMissing = require('ember-cli-is-package-missing');
const semver = require('semver');
-const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
-const path = require('path');
+const useTestFrameworkDetector = require('../test-framework-detector');
module.exports = useTestFrameworkDetector({
- description: 'Generates a helper integration test or a unit test.',
-
- availableOptions: [
- {
- name: 'test-type',
- type: ['integration', 'unit'],
- default: 'integration',
- aliases: [
- { i: 'integration' },
- { u: 'unit' },
- { integration: 'integration' },
- { unit: 'unit' },
- ],
- },
- ],
+ description: 'Generates a helper integration test.',
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.inRepoAddon) {
- return path.join('packages', options.inRepoAddon, 'src');
- }
+ shouldTransformTypeScript: true,
- if (options.inDummy) {
- throw new Error("The --dummy flag isn't supported within a module unification app");
- }
-
- return 'src';
- },
- __testType__() {
- return '';
- },
- __collection__() {
- return 'ui/components';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__(options) {
- return options.locals.testType || 'integration';
- },
- __collection__() {
- return 'helpers';
- },
- };
- }
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
- locals: function(options) {
- let testType = options.testType || 'integration';
- let testName = testType === 'integration' ? 'Integration' : 'Unit';
- let friendlyTestName = [testName, 'Helper', options.entity.name].join(' | ');
- let dasherizedModulePrefix;
+ fileMapTokens: function () {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'integration';
+ },
+ };
+ },
- if (
- isModuleUnificationProject(options.project) &&
- (options.project.isEmberCLIAddon() || options.inRepoAddon)
- ) {
- dasherizedModulePrefix = options.inRepoAddon || options.project.name();
- } else {
- dasherizedModulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);
- }
+ locals: function (options) {
+ let friendlyTestName = ['Integration', 'Helper', options.entity.name].join(' | ');
let hbsImportStatement = this._useNamedHbsImport()
? "import { hbs } from 'ember-cli-htmlbars';"
: "import hbs from 'htmlbars-inline-precompile';";
return {
- testType,
+ modulePrefix: modulePrefixForProject(options.project),
friendlyTestName,
- dasherizedModulePrefix,
hbsImportStatement,
};
},
_useNamedHbsImport() {
- let htmlbarsAddon = this.project.addons.find(a => a.name === 'ember-cli-htmlbars');
+ let htmlbarsAddon = this.project.addons.find((a) => a.name === 'ember-cli-htmlbars');
if (htmlbarsAddon && semver.gte(htmlbarsAddon.pkg.version, '4.0.0-alpha.1')) {
return true;
@@ -99,10 +53,9 @@ module.exports = useTestFrameworkDetector({
return false;
},
- afterInstall: function(options) {
+ afterInstall: function (options) {
if (
!options.dryRun &&
- options.testType === 'integration' &&
!this._useNamedHbsImport() &&
isPackageMissing(this, 'ember-cli-htmlbars-inline-precompile')
) {
diff --git a/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js
deleted file mode 100644
index 5e27688598d..00000000000
--- a/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js
+++ /dev/null
@@ -1,38 +0,0 @@
-import { expect } from 'chai';
-<% if (testType == 'integration') { %>import { describe, it } from 'mocha';
-import { setupComponentTest } from 'ember-mocha';
-import hbs from 'htmlbars-inline-precompile';
-
-describe('<%= friendlyTestName %>', function() {
- setupComponentTest('<%= dasherizedModuleName %>', {
- integration: true
- });
-
- it('renders', function() {
- // Set any properties with this.set('myProperty', 'value');
- // Handle any actions with this.on('myAction', function(val) { ... });
- // Template block usage:
- // this.render(hbs`
- // {{#<%= dasherizedModuleName %>}}
- // template content
- // {{/<%= dasherizedModuleName %>}}
- // `);
- this.set('inputValue', '1234');
-
- this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
-
- expect(this.$().text().trim()).to.equal('1234');
- });
-});
-<% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
-import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
-
-describe('<%= friendlyTestName %>', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = <%= camelizedModuleName %>(42);
- expect(result).to.be.ok;
- });
-});
-<% } %>
diff --git a/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js b/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..cdb02d28391
--- /dev/null
+++ b/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,26 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupComponentTest } from 'ember-mocha';
+import hbs from 'htmlbars-inline-precompile';
+
+describe('<%= friendlyTestName %>', function () {
+ setupComponentTest('<%= dasherizedModuleName %>', {
+ integration: true,
+ });
+
+ it('renders', function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+ // Template block usage:
+ // this.render(hbs`
+ // {{#<%= dasherizedModuleName %>}}
+ // template content
+ // {{/<%= dasherizedModuleName %>}}
+ // `);
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.$().text().trim()).to.equal('1234');
+ });
+});
diff --git a/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js
deleted file mode 100644
index 0e9276ae197..00000000000
--- a/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import { expect } from 'chai';
-<% if (testType == 'integration') { %>
-import { describeComponent, it } from 'ember-mocha';
-import hbs from 'htmlbars-inline-precompile';
-
-describeComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>',
- {
- integration: true
- },
- function() {
- it('renders', function() {
- // Set any properties with this.set('myProperty', 'value');
- // Handle any actions with this.on('myAction', function(val) { ... });
- // Template block usage:
- // this.render(hbs`
- // {{#<%= dasherizedModuleName %>}}
- // template content
- // {{/<%= dasherizedModuleName %>}}
- // `);
- this.set('inputValue', '1234');
-
- this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
-
- expect(this.$().text().trim()).to.equal('1234');
- });
- }
-);
-<% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
-import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
-
-describe('<%= friendlyTestName %>', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = <%= camelizedModuleName %>(42);
- expect(result).to.be.ok;
- });
-});
-<% } %>
diff --git a/blueprints/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js b/blueprints/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..843e9b35bcf
--- /dev/null
+++ b/blueprints/helper-test/mocha-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,28 @@
+import { expect } from 'chai';
+import { describeComponent, it } from 'ember-mocha';
+import hbs from 'htmlbars-inline-precompile';
+
+describeComponent(
+ '<%= dasherizedModuleName %>',
+ 'helper:<%= dasherizedModuleName %>',
+ {
+ integration: true,
+ },
+ function () {
+ it('renders', function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.on('myAction', function(val) { ... });
+ // Template block usage:
+ // this.render(hbs`
+ // {{#<%= dasherizedModuleName %>}}
+ // template content
+ // {{/<%= dasherizedModuleName %>}}
+ // `);
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.$().text().trim()).to.equal('1234');
+ });
+ }
+);
diff --git a/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js
deleted file mode 100644
index 62a21879351..00000000000
--- a/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { expect } from 'chai';
-<% if (testType == 'integration') { %>import { describe, it } from 'mocha';
-import { setupRenderingTest } from 'ember-mocha';
-import { render } from '@ember/test-helpers';
-<%= hbsImportStatement %>
-
-describe('<%= friendlyTestName %>', function() {
- setupRenderingTest();
-
- // TODO: Replace this with your real tests.
- it('renders', async function() {
- this.set('inputValue', '1234');
-
- await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
-
- expect(this.element.textContent.trim()).to.equal('1234');
- });
-});<% } else if (testType == 'unit') { %>import { describe, it } from 'mocha';
-import { <%= camelizedModuleName %> } from '<%= dasherizedPackageName %>/helpers/<%= dasherizedModuleName %>';
-
-describe('<%= friendlyTestName %>', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = <%= camelizedModuleName %>(42);
- expect(result).to.be.ok;
- });
-});<% } %>
diff --git a/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts b/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts
new file mode 100644
index 00000000000..1d317244677
--- /dev/null
+++ b/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts
@@ -0,0 +1,18 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+describe('<%= friendlyTestName %>', function () {
+ setupRenderingTest();
+
+ // TODO: Replace this with your real tests.
+ it('renders', async function () {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ expect(this.element.textContent.trim()).to.equal('1234');
+ });
+});
diff --git a/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js
deleted file mode 100644
index 2182592ebcd..00000000000
--- a/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js
+++ /dev/null
@@ -1,26 +0,0 @@
-<% if (testType == 'integration') { %>import { moduleForComponent, test } from 'ember-qunit';
-import hbs from 'htmlbars-inline-precompile';
-
-moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>', {
- integration: true
-});
-
-// TODO: Replace this with your real tests.
-test('it renders', function(assert) {
- this.set('inputValue', '1234');
-
- this.render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
-
- assert.equal(this.$().text().trim(), '1234');
-});<% } else if (testType == 'unit') { %>
-import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>';
-import { module, test } from 'qunit';
-
-module('<%= friendlyTestName %>');
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- let result = <%= camelizedModuleName %>([42]);
- assert.ok(result);
-});
-<% } %>
diff --git a/blueprints/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js b/blueprints/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js
new file mode 100644
index 00000000000..45b8e177f2c
--- /dev/null
+++ b/blueprints/helper-test/qunit-files/__root__/__testType__/helpers/__name__-test.js
@@ -0,0 +1,15 @@
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+
+moduleForComponent('<%= dasherizedModuleName %>', 'helper:<%= dasherizedModuleName %>', {
+ integration: true,
+});
+
+// TODO: Replace this with your real tests.
+test('it renders', function (assert) {
+ this.set('inputValue', '1234');
+
+ this.render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ assert.strictEqual(this.$().text().trim(), '1234');
+});
diff --git a/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js b/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js
deleted file mode 100644
index 96970ee27bc..00000000000
--- a/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-<% if (testType === 'integration') { %>import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
-import { render } from '@ember/test-helpers';
-<%= hbsImportStatement %>
-
-module('<%= friendlyTestName %>', function(hooks) {
- setupRenderingTest(hooks);
-
- // TODO: Replace this with your real tests.
- test('it renders', async function(assert) {
- this.set('inputValue', '1234');
-
- await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
-
- assert.equal(this.element.textContent.trim(), '1234');
- });
-});<% } else if (testType === 'unit') { %>import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>';
-import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('<%= friendlyTestName %>', function(hooks) {
- setupTest(hooks);
-
- // TODO: Replace this with your real tests.
- test('it works', function(assert) {
- let result = <%= camelizedModuleName %>([42]);
- assert.ok(result);
- });
-});<% } %>
diff --git a/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts b/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts
new file mode 100644
index 00000000000..a04bbbf5077
--- /dev/null
+++ b/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/helpers/__name__-test.ts
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
+import { render } from '@ember/test-helpers';
+<%= hbsImportStatement %>
+
+module('<%= friendlyTestName %>', function (hooks) {
+ setupRenderingTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it renders', async function (assert) {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{<%= dasherizedModuleName %> this.inputValue}}`);
+
+ assert.dom(this.element).hasText('1234');
+ });
+});
diff --git a/blueprints/helper/files/__root__/__collection__/__name__.js b/blueprints/helper/files/__root__/__collection__/__name__.js
deleted file mode 100644
index c127f0fc431..00000000000
--- a/blueprints/helper/files/__root__/__collection__/__name__.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { helper } from '@ember/component/helper';
-
-export default helper(function <%= camelizedModuleName %>(params/*, hash*/) {
- return params;
-});
diff --git a/blueprints/helper/files/__root__/helpers/__name__.ts b/blueprints/helper/files/__root__/helpers/__name__.ts
new file mode 100644
index 00000000000..786682850a6
--- /dev/null
+++ b/blueprints/helper/files/__root__/helpers/__name__.ts
@@ -0,0 +1,5 @@
+import { helper } from '@ember/component/helper';
+
+export default helper(function <%= camelizedModuleName %>(positional /*, named*/) {
+ return positional;
+});
diff --git a/blueprints/helper/index.js b/blueprints/helper/index.js
index 5aaca5f9068..5965e7767cf 100644
--- a/blueprints/helper/index.js
+++ b/blueprints/helper/index.js
@@ -1,54 +1,20 @@
'use strict';
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
const normalizeEntityName = require('ember-cli-normalize-entity-name');
-const path = require('path');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
module.exports = {
description: 'Generates a helper function.',
- filesPath() {
- let rootPath = isModuleUnificationProject(this.project) ? 'mu-files' : 'files';
- return path.join(this.path, rootPath);
- },
-
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
-
- if (options.inRepoAddon) {
- return path.join('packages', options.inRepoAddon, 'src');
- }
-
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
-
- return 'src';
- },
- __collection__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
+ shouldTransformTypeScript: true,
- return path.join('ui', 'components');
- },
- };
- } else {
- return {
- __collection__() {
- return 'helpers';
- },
- };
- }
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return normalizeEntityName(
entityName.replace(/\.js$/, '') //Prevent generation of ".js.js" files
);
diff --git a/blueprints/helper/mu-files/__root__/__collection__/__name__.js b/blueprints/helper/mu-files/__root__/__collection__/__name__.js
deleted file mode 100644
index 28a6eb4764f..00000000000
--- a/blueprints/helper/mu-files/__root__/__collection__/__name__.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import { helper as buildHelper } from '@ember/component/helper';
-
-export function <%= camelizedModuleName %>(params/*, hash*/) {
- return params;
-}
-
-export const helper = buildHelper(<%= camelizedModuleName %>);
diff --git a/blueprints/initializer-addon/files/__root__/__path__/__name__.ts b/blueprints/initializer-addon/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..79e541af69d
--- /dev/null
+++ b/blueprints/initializer-addon/files/__root__/__path__/__name__.ts
@@ -0,0 +1 @@
+export { default, initialize } from '<%= modulePath %>';
diff --git a/blueprints/initializer-test/index.js b/blueprints/initializer-test/index.js
index 8394f9c5dbe..fd0ae11bd87 100644
--- a/blueprints/initializer-test/index.js
+++ b/blueprints/initializer-test/index.js
@@ -2,49 +2,36 @@
const fs = require('fs');
const path = require('path');
-const stringUtils = require('ember-cli-string-utils');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
module.exports = useTestFrameworkDetector({
description: 'Generates an initializer unit test.',
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error('Pods arenʼt supported within a module unification app');
- } else if (options.inDummy) {
- return path.join('tests', 'dummy', 'src', 'init');
- }
- return path.join('src', 'init');
- },
- __testType__() {
- return '';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return 'unit';
- },
- };
- }
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'unit';
+ },
+ };
},
- locals: function(options) {
- let modulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);
- if (isModuleUnificationProject(this.project)) {
- modulePrefix += '/init';
- }
+ locals: function (options) {
return {
friendlyTestName: ['Unit', 'Initializer', options.entity.name].join(' | '),
- modulePrefix,
+ modulePrefix: modulePrefixForProject(options.project),
destroyAppExists: fs.existsSync(
path.join(this.project.root, '/tests/helpers/destroy-app.js')
),
diff --git a/blueprints/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
index 2359278209b..5c3ed1a4a17 100644
--- a/blueprints/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
+++ b/blueprints/initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
@@ -3,24 +3,23 @@ import { describe, it, beforeEach, afterEach } from 'mocha';
import { run } from '@ember/runloop';
import Application from '@ember/application';
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } %>
-
-describe('<%= friendlyTestName %>', function() {
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';\n<% } %>
+describe('<%= friendlyTestName %>', function () {
let application;
- beforeEach(function() {
- run(function() {
+ beforeEach(function () {
+ run(function () {
application = Application.create();
application.deferReadiness();
});
});
- afterEach(function() {
+ afterEach(function () {
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
});
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
initialize(application);
// you would normally confirm the results of the initializer here
diff --git a/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
deleted file mode 100644
index a76e9fb041b..00000000000
--- a/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, beforeEach, afterEach } from 'mocha';
-import Application from '@ember/application';
-import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
-
-describe('<%= friendlyTestName %>', function() {
- beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.initializer({
- name: 'initializer under test',
- initialize
- });
-
- this.application = this.TestApplication.create({ autoboot: false });
- });
-
- afterEach(function() {
- <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- });
-
- // TODO: Replace this with your real tests.
- it('works', async function() {
- await this.application.boot();
-
- // you would normally confirm the results of the initializer here
- expect(true).to.be.ok;
- });
-});
diff --git a/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts b/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
new file mode 100644
index 00000000000..bf3e61a425a
--- /dev/null
+++ b/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
@@ -0,0 +1,31 @@
+import { expect } from 'chai';
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import Application from '@ember/application';
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+describe('<%= friendlyTestName %>', function () {
+ beforeEach(function () {
+ this.TestApplication = Application.extend();
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false
+ });
+ });
+
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', async function () {
+ await this.application.boot();
+
+ // you would normally confirm the results of the initializer here
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
index 809b65a6639..4a3131618ea 100644
--- a/blueprints/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
+++ b/blueprints/initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
@@ -3,8 +3,7 @@ import { run } from '@ember/runloop';
import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } %>
-
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';\n<% } %>
module('<%= friendlyTestName %>', {
beforeEach() {
run(() => {
@@ -14,11 +13,11 @@ module('<%= friendlyTestName %>', {
},
afterEach() {
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.application);
// you would normally confirm the results of the initializer here
diff --git a/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
deleted file mode 100644
index 0ef7a9944e6..00000000000
--- a/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Application from '@ember/application';
-
-import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
-import { module, test } from 'qunit';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
-
-module('<%= friendlyTestName %>', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.initializer({
- name: 'initializer under test',
- initialize
- });
-
- this.application = this.TestApplication.create({ autoboot: false });
- });
-
- hooks.afterEach(function() {
- <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- });
-
- // TODO: Replace this with your real tests.
- test('it works', async function(assert) {
- await this.application.boot();
-
- assert.ok(true);
- });
-});
diff --git a/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts b/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
new file mode 100644
index 00000000000..53ff55c7b0b
--- /dev/null
+++ b/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
@@ -0,0 +1,37 @@
+import Application from '@ember/application';
+
+import config from '<%= modulePrefix %>/config/environment';
+import { initialize } from '<%= modulePrefix %>/initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app'; <% } else { %>import { run } from '@ember/runloop'; <% } %>
+
+ module('<%= friendlyTestName %>', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.initializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false
+ });
+ });
+
+ hooks.afterEach(function () {
+ <% if (destroyAppExists) { %> destroyApp(this.application); <% } else { %> run(this.application, 'destroy'); <% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.application.boot();
+
+ assert.ok(true);
+ });
+ });
diff --git a/blueprints/initializer/files/__root__/initializers/__name__.js b/blueprints/initializer/files/__root__/initializers/__name__.js
deleted file mode 100644
index dfb969b2702..00000000000
--- a/blueprints/initializer/files/__root__/initializers/__name__.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export function initialize(/* application */) {
- // application.inject('route', 'foo', 'service:foo');
-}
-
-export default {
- initialize
-};
diff --git a/blueprints/initializer/files/__root__/initializers/__name__.ts b/blueprints/initializer/files/__root__/initializers/__name__.ts
new file mode 100644
index 00000000000..a57249cc00e
--- /dev/null
+++ b/blueprints/initializer/files/__root__/initializers/__name__.ts
@@ -0,0 +1,6 @@
+export function initialize(application) {
+}
+
+export default {
+ initialize
+};
diff --git a/blueprints/initializer/index.js b/blueprints/initializer/index.js
index d241e963531..932cd98bd04 100644
--- a/blueprints/initializer/index.js
+++ b/blueprints/initializer/index.js
@@ -1,23 +1,14 @@
'use strict';
-const path = require('path');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
module.exports = {
description: 'Generates an initializer.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error('Pods arenʼt supported within a module unification app');
- } else if (options.inDummy) {
- return path.join('tests', 'dummy', 'src/init');
- }
- return 'src/init';
- },
- };
- }
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
};
diff --git a/blueprints/instance-initializer-addon/files/__root__/__path__/__name__.ts b/blueprints/instance-initializer-addon/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..79e541af69d
--- /dev/null
+++ b/blueprints/instance-initializer-addon/files/__root__/__path__/__name__.ts
@@ -0,0 +1 @@
+export { default, initialize } from '<%= modulePath %>';
diff --git a/blueprints/instance-initializer-test/index.js b/blueprints/instance-initializer-test/index.js
index 64f6bc22cd9..53f87ae56ef 100644
--- a/blueprints/instance-initializer-test/index.js
+++ b/blueprints/instance-initializer-test/index.js
@@ -2,48 +2,35 @@
const fs = require('fs');
const path = require('path');
-const stringUtils = require('ember-cli-string-utils');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
module.exports = useTestFrameworkDetector({
description: 'Generates an instance initializer unit test.',
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error('Pods arenʼt supported within a module unification app');
- } else if (options.inDummy) {
- return path.join('tests', 'dummy', 'src', 'init');
- }
- return path.join('src', 'init');
- },
- __testType__() {
- return '';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return 'unit';
- },
- };
- }
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'unit';
+ },
+ };
},
- locals: function(options) {
- let modulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);
- if (isModuleUnificationProject(this.project)) {
- modulePrefix += '/init';
- }
+ locals: function (options) {
return {
friendlyTestName: ['Unit', 'Instance Initializer', options.entity.name].join(' | '),
- modulePrefix,
+ modulePrefix: modulePrefixForProject(options.project),
destroyAppExists: fs.existsSync(
path.join(this.project.root, '/tests/helpers/destroy-app.js')
),
diff --git a/blueprints/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
index 43199ba3bf5..9be570cf8d0 100644
--- a/blueprints/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
+++ b/blueprints/instance-initializer-test/mocha-files/__root__/__testType__/__path__/__name__-test.js
@@ -5,23 +5,23 @@ import { run } from '@ember/runloop';
import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import destroyApp from '../../helpers/destroy-app';
-describe('<%= friendlyTestName %>', function() {
+describe('<%= friendlyTestName %>', function () {
let application, appInstance;
- beforeEach(function() {
- run(function() {
+ beforeEach(function () {
+ run(function () {
application = Application.create();
appInstance = application.buildInstance();
});
});
- afterEach(function() {
+ afterEach(function () {
run(appInstance, 'destroy');
destroyApp(application);
});
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
initialize(appInstance);
// you would normally confirm the results of the initializer here
diff --git a/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
deleted file mode 100644
index 7b680e4f19e..00000000000
--- a/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, beforeEach, afterEach } from 'mocha';
-import Application from '@ember/application';
-import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
-
-describe('<%= friendlyTestName %>', function() {
- beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.instanceInitializer({
- name: 'initializer under test',
- initialize
- });
- this.application = this.TestApplication.create({ autoboot: false });
- this.instance = this.application.buildInstance();
- });
- afterEach(function() {
- <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
- <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- });
-
- // TODO: Replace this with your real tests.
- it('works', async function() {
- await this.instance.boot();
-
- expect(true).to.be.ok;
- });
-});
diff --git a/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts b/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
new file mode 100644
index 00000000000..eb20199ccba
--- /dev/null
+++ b/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
@@ -0,0 +1,32 @@
+import { expect } from 'chai';
+import { describe, it, beforeEach, afterEach } from 'mocha';
+import Application from '@ember/application';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+describe('<%= friendlyTestName %>', function () {
+ beforeEach(function () {
+ this.TestApplication = Application.extend();
+ this.TestApplication.instanceInitializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false
+ });
+
+ this.instance = this.application.buildInstance();
+ });
+ afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ it('works', async function () {
+ await this.instance.boot();
+
+ expect(true).to.be.ok;
+ });
+});
diff --git a/blueprints/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
index 6f075d87ce4..9f056812709 100644
--- a/blueprints/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
+++ b/blueprints/instance-initializer-test/qunit-files/__root__/__testType__/__path__/__name__-test.js
@@ -14,11 +14,11 @@ module('<%= friendlyTestName %>', {
afterEach() {
run(this.appInstance, 'destroy');
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.appInstance);
// you would normally confirm the results of the initializer here
diff --git a/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js b/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
deleted file mode 100644
index 7efaeafe77a..00000000000
--- a/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Application from '@ember/application';
-
-import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
-import { module, test } from 'qunit';
-<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
-
-module('<%= friendlyTestName %>', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.instanceInitializer({
- name: 'initializer under test',
- initialize
- });
- this.application = this.TestApplication.create({ autoboot: false });
- this.instance = this.application.buildInstance();
- });
- hooks.afterEach(function() {
- <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
- <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
- });
-
- // TODO: Replace this with your real tests.
- test('it works', async function(assert) {
- await this.instance.boot();
-
- assert.ok(true);
- });
-});
diff --git a/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts b/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
new file mode 100644
index 00000000000..947e4c8a38f
--- /dev/null
+++ b/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts
@@ -0,0 +1,39 @@
+import Application from '@ember/application';
+
+import config from '<%= modulePrefix %>/config/environment';
+import { initialize } from '<%= modulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
+<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
+
+module('<%= friendlyTestName %>', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
+ this.TestApplication.instanceInitializer({
+ name: 'initializer under test',
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false
+ });
+
+ this.instance = this.application.buildInstance();
+ });
+ hooks.afterEach(function () {
+ <% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
+ <% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
+ });
+
+ // TODO: Replace this with your real tests.
+ test('it works', async function (assert) {
+ await this.instance.boot();
+
+ assert.ok(true);
+ });
+});
diff --git a/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js b/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js
deleted file mode 100644
index 2f84dce8d92..00000000000
--- a/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export function initialize(/* appInstance */) {
- // appInstance.inject('route', 'foo', 'service:foo');
-}
-
-export default {
- initialize
-};
diff --git a/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.ts b/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.ts
new file mode 100644
index 00000000000..b7ee40e953c
--- /dev/null
+++ b/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.ts
@@ -0,0 +1,6 @@
+export function initialize(owner) {
+}
+
+export default {
+ initialize
+};
diff --git a/blueprints/instance-initializer/index.js b/blueprints/instance-initializer/index.js
index 533141bff4f..c8d4dacdd1c 100644
--- a/blueprints/instance-initializer/index.js
+++ b/blueprints/instance-initializer/index.js
@@ -1,23 +1,14 @@
'use strict';
-const path = require('path');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
module.exports = {
+ shouldTransformTypeScript: true,
+
description: 'Generates an instance initializer.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error('Pods arenʼt supported within a module unification app');
- } else if (options.inDummy) {
- return path.join('tests', 'dummy', 'src/init');
- }
- return 'src/init';
- },
- };
- }
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
};
diff --git a/blueprints/mixin-test/index.js b/blueprints/mixin-test/index.js
index f55cbc640e6..73067ea9d0c 100644
--- a/blueprints/mixin-test/index.js
+++ b/blueprints/mixin-test/index.js
@@ -3,38 +3,22 @@
const path = require('path');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
module.exports = useTestFrameworkDetector({
description: 'Generates a mixin unit test.',
fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
-
- return 'src';
- },
- __testType__() {
- return 'mixins';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return path.join('unit', 'mixins');
- },
- };
- }
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return path.join('unit', 'mixins');
+ },
+ };
},
- locals: function(options) {
+ locals: function (options) {
return {
projectName: options.inRepoAddon ? options.inRepoAddon : options.project.name(),
friendlyTestName: ['Unit', 'Mixin', options.entity.name].join(' | '),
diff --git a/blueprints/mixin-test/mocha-files/__root__/__testType__/__name__-test.js b/blueprints/mixin-test/mocha-files/__root__/__testType__/__name__-test.js
index 34491730117..915c4202a81 100644
--- a/blueprints/mixin-test/mocha-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/mixin-test/mocha-files/__root__/__testType__/__name__-test.js
@@ -3,9 +3,9 @@ import { describe, it } from 'mocha';
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= dasherizedPackageName %>/mixins/<%= dasherizedModuleName %>';
-describe('<%= friendlyTestName %>', function() {
+describe('<%= friendlyTestName %>', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
expect(subject).to.be.ok;
diff --git a/blueprints/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
index 34491730117..915c4202a81 100644
--- a/blueprints/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/mixin-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -3,9 +3,9 @@ import { describe, it } from 'mocha';
import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= dasherizedPackageName %>/mixins/<%= dasherizedModuleName %>';
-describe('<%= friendlyTestName %>', function() {
+describe('<%= friendlyTestName %>', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
expect(subject).to.be.ok;
diff --git a/blueprints/mixin-test/qunit-files/__root__/__testType__/__name__-test.js b/blueprints/mixin-test/qunit-files/__root__/__testType__/__name__-test.js
index 7888ebc1d68..00579ff7c02 100644
--- a/blueprints/mixin-test/qunit-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/mixin-test/qunit-files/__root__/__testType__/__name__-test.js
@@ -5,7 +5,7 @@ import { module, test } from 'qunit';
module('<%= friendlyTestName %>');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
assert.ok(subject);
diff --git a/blueprints/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
index de7dde8fe26..034a718d852 100644
--- a/blueprints/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/mixin-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
@@ -2,7 +2,7 @@ import EmberObject from '@ember/object';
import <%= classifiedModuleName %>Mixin from '<%= projectName %>/mixins/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
-module('<%= friendlyTestName %>', function() {
+module('<%= friendlyTestName %>', function () {
// TODO: Replace this with your real tests.
test('it works', function (assert) {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
diff --git a/blueprints/mixin/files/__root__/mixins/__name__.js b/blueprints/mixin/files/__root__/mixins/__name__.js
index 4f1bab5d000..9aa7bf677d8 100644
--- a/blueprints/mixin/files/__root__/mixins/__name__.js
+++ b/blueprints/mixin/files/__root__/mixins/__name__.js
@@ -1,4 +1,3 @@
import Mixin from '@ember/object/mixin';
-export default Mixin.create({
-});
+export default Mixin.create({});
diff --git a/blueprints/mixin/index.js b/blueprints/mixin/index.js
index 929d1cc0303..22061781a0f 100644
--- a/blueprints/mixin/index.js
+++ b/blueprints/mixin/index.js
@@ -1,29 +1,8 @@
'use strict';
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
-const path = require('path');
-
module.exports = {
description: 'Generates a mixin.',
-
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
-
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
-
- return 'src';
- },
- };
- }
- },
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
},
};
diff --git a/blueprints/module-unification.js b/blueprints/module-unification.js
deleted file mode 100644
index aa7f4683ae7..00000000000
--- a/blueprints/module-unification.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-module.exports = {
- isModuleUnificationProject(project) {
- return project && project.isModuleUnification && project.isModuleUnification();
- },
-};
diff --git a/blueprints/route-addon/files/__root__/__path__/__name__.ts b/blueprints/route-addon/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..d921567455f
--- /dev/null
+++ b/blueprints/route-addon/files/__root__/__path__/__name__.ts
@@ -0,0 +1 @@
+export { default } from '<%= routeModulePath %>';
diff --git a/blueprints/route-addon/index.js b/blueprints/route-addon/index.js
index 6727e51cb1e..171cdeea2a9 100644
--- a/blueprints/route-addon/index.js
+++ b/blueprints/route-addon/index.js
@@ -4,38 +4,47 @@ const path = require('path');
const stringUtil = require('ember-cli-string-utils');
const inflector = require('inflection');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
module.exports = {
description: 'Generates import wrappers for a route and its template.',
- fileMapTokens: function() {
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
return {
- __templatepath__: function(options) {
+ __templatepath__: function (options) {
if (options.pod) {
return path.join(options.podPath, options.dasherizedModuleName);
}
return 'templates';
},
- __templatename__: function(options) {
+ __templatename__: function (options) {
if (options.pod) {
return 'template';
}
return options.dasherizedModuleName;
},
- __name__: function(options) {
+ __name__: function (options) {
if (options.pod) {
return 'route';
}
return options.dasherizedModuleName;
},
- __path__: function(options) {
+ __path__: function (options) {
if (options.pod && options.hasPathToken) {
return path.join(options.podPath, options.dasherizedModuleName);
}
return 'routes';
},
- __root__: function(options) {
+ __root__: function (options) {
if (options.inRepoAddon) {
return path.join('lib', options.inRepoAddon, 'app');
}
@@ -45,13 +54,13 @@ module.exports = {
};
},
- locals: function(options) {
+ locals: function (options) {
let locals = {};
let addonRawName = options.inRepoAddon ? options.inRepoAddon : options.project.name();
let addonName = stringUtil.dasherize(addonRawName);
let fileName = stringUtil.dasherize(options.entity.name);
- ['route', 'template'].forEach(function(blueprint) {
+ ['route', 'template'].forEach(function (blueprint) {
let pathName = [addonName, inflector.pluralize(blueprint), fileName].join('/');
if (options.pod) {
diff --git a/blueprints/route-test/index.js b/blueprints/route-test/index.js
index 1ba5e879c8e..e546a8b13c3 100644
--- a/blueprints/route-test/index.js
+++ b/blueprints/route-test/index.js
@@ -2,12 +2,21 @@
const path = require('path');
const stringUtil = require('ember-cli-string-utils');
+
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
module.exports = useTestFrameworkDetector({
description: 'Generates a route unit test.',
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
availableOptions: [
{
name: 'reset-namespace',
@@ -15,53 +24,33 @@ module.exports = useTestFrameworkDetector({
},
],
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __test__() {
- return 'route-test';
- },
- __root__(options) {
- if (options.inRepoAddon) {
- return path.join('packages', options.inRepoAddon, 'src');
- }
- return 'src';
- },
- __testType__() {
- return '';
- },
- __path__(options) {
- return path.join('ui', 'routes', options.dasherizedModuleName);
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return 'unit';
- },
- __test__: function(options) {
- let moduleName = options.locals.moduleName;
+ fileMapTokens: function () {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'unit';
+ },
+ __test__: function (options) {
+ let moduleName = options.locals.moduleName;
- if (options.pod) {
- moduleName = 'route';
- }
+ if (options.pod) {
+ moduleName = 'route';
+ }
- return `${moduleName}-test`;
- },
- __path__: function(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.moduleName);
- }
- return 'routes';
- },
- };
- }
+ return `${moduleName}-test`;
+ },
+ __path__: function (options) {
+ if (options.pod) {
+ return path.join(options.podPath, options.locals.moduleName);
+ }
+ return 'routes';
+ },
+ };
},
- locals: function(options) {
+ locals: function (options) {
let moduleName = options.entity.name;
if (options.resetNamespace) {
@@ -69,6 +58,7 @@ module.exports = useTestFrameworkDetector({
}
return {
+ modulePrefix: modulePrefixForProject(options.project),
friendlyTestDescription: ['Unit', 'Route', options.entity.name].join(' | '),
moduleName: stringUtil.dasherize(moduleName),
};
diff --git a/blueprints/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
index 8b8f8ca18e7..4764e61b2e9 100644
--- a/blueprints/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/route-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -2,13 +2,13 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('<%= friendlyTestDescription %>', function() {
+describe('<%= friendlyTestDescription %>', function () {
setupTest('route:<%= moduleName %>', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
- it('exists', function() {
+ it('exists', function () {
let route = this.subject();
expect(route).to.be.ok;
});
diff --git a/blueprints/route-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/mocha-files/__root__/__testType__/__path__/__test__.js
index ef17729f4ce..e2f6ecb1547 100644
--- a/blueprints/route-test/mocha-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/route-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -1,13 +1,15 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('route:<%= moduleName %>', '<%= friendlyTestDescription %>',
+describeModule(
+ 'route:<%= moduleName %>',
+ '<%= friendlyTestDescription %>',
{
// Specify the other units that are required for this test.
// needs: ['controller:foo']
},
- function() {
- it('exists', function() {
+ function () {
+ it('exists', function () {
let route = this.subject();
expect(route).to.be.ok;
});
diff --git a/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index f2d0456e955..00000000000
--- a/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
-
-describe('<%= friendlyTestDescription %>', function() {
- setupTest();
-
- it('exists', function() {
- let route = this.owner.lookup('route:<%= dasherizedModuleName %>');
- expect(route).to.be.ok;
- });
-});
diff --git a/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..8a55ca6c2f0
--- /dev/null
+++ b/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,12 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ it('exists', function () {
+ let route = this.owner.lookup('route:<%= dasherizedModuleName %>');
+ expect(route).to.be.ok;
+ });
+});
diff --git a/blueprints/route-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/qunit-files/__root__/__testType__/__path__/__test__.js
index 7ef49ffdb0e..44232623e38 100644
--- a/blueprints/route-test/qunit-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/route-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -5,7 +5,7 @@ moduleFor('route:<%= moduleName %>', '<%= friendlyTestDescription %>', {
// needs: ['controller:foo']
});
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let route = this.subject();
assert.ok(route);
});
diff --git a/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index f3ed6df1c17..00000000000
--- a/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('<%= friendlyTestDescription %>', function(hooks) {
- setupTest(hooks);
-
- test('it exists', function(assert) {
- let route = this.owner.lookup('route:<%= moduleName %>');
- assert.ok(route);
- });
-});
diff --git a/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..942fd41cc9c
--- /dev/null
+++ b/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:<%= moduleName %>');
+ assert.ok(route);
+ });
+});
diff --git a/blueprints/route/files/__root__/__path__/__name__.js b/blueprints/route/files/__root__/__path__/__name__.js
deleted file mode 100644
index 6c74252aa1b..00000000000
--- a/blueprints/route/files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Route from '@ember/routing/route';
-
-export default Route.extend({
-});
diff --git a/blueprints/route/files/__root__/__path__/__name__.ts b/blueprints/route/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..aeb39c6b91b
--- /dev/null
+++ b/blueprints/route/files/__root__/__path__/__name__.ts
@@ -0,0 +1,9 @@
+import Route from '@ember/routing/route';
+
+export default class <%= classifiedModuleName %>Route extends Route {<% if (hasDynamicSegment) {%>
+ model(params) {
+ // This route was generated with a dynamic segment. Implement data loading
+ // based on that dynamic segment here in the model hook.
+ return params;
+ }
+<%}%>}
diff --git a/blueprints/route/files/__root__/__templatepath__/__templatename__.hbs b/blueprints/route/files/__root__/__templatepath__/__templatename__.hbs
index e2147cab02d..9857cee0c36 100644
--- a/blueprints/route/files/__root__/__templatepath__/__templatename__.hbs
+++ b/blueprints/route/files/__root__/__templatepath__/__templatename__.hbs
@@ -1 +1,2 @@
-{{outlet}}
\ No newline at end of file
+<% if (addTitle) {%>{{page-title "<%= routeName %>"}}
+<%}%>{{outlet}}
\ No newline at end of file
diff --git a/blueprints/route/index.js b/blueprints/route/index.js
index beb2ad74c41..6385b295762 100644
--- a/blueprints/route/index.js
+++ b/blueprints/route/index.js
@@ -5,12 +5,15 @@ const path = require('path');
const chalk = require('chalk');
const stringUtil = require('ember-cli-string-utils');
const EmberRouterGenerator = require('ember-router-generator');
-const useEditionDetector = require('../edition-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const SilentError = require('silent-error');
-module.exports = useEditionDetector({
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+
+module.exports = {
description: 'Generates a route and a template, and registers the route with the router.',
+ shouldTransformTypeScript: true,
+
availableOptions: [
{
name: 'path',
@@ -28,89 +31,74 @@ module.exports = useEditionDetector({
},
],
- fileMapTokens: function() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
- return 'src';
- },
- __path__(options) {
- return path.join('ui', 'routes', options.dasherizedModuleName);
- },
- __name__() {
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
+
+ fileMapTokens: function () {
+ return {
+ __name__(options) {
+ if (options.pod) {
return 'route';
- },
- __templatepath__(options) {
- return path.join('ui', 'routes', options.dasherizedModuleName);
- },
- __templatename__() {
+ }
+ return options.locals.moduleName;
+ },
+ __path__(options) {
+ if (options.pod) {
+ return path.join(options.podPath, options.locals.moduleName);
+ }
+ return 'routes';
+ },
+ __templatepath__(options) {
+ if (options.pod) {
+ return path.join(options.podPath, options.locals.moduleName);
+ }
+ return 'templates';
+ },
+ __templatename__(options) {
+ if (options.pod) {
return 'template';
- },
- };
- } else {
- return {
- __name__(options) {
- if (options.pod) {
- return 'route';
- }
- return options.locals.moduleName;
- },
- __path__(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.moduleName);
- }
- return 'routes';
- },
- __templatepath__(options) {
- if (options.pod) {
- return path.join(options.podPath, options.locals.moduleName);
- }
- return 'templates';
- },
- __templatename__(options) {
- if (options.pod) {
- return 'template';
- }
- return options.locals.moduleName;
- },
- __root__(options) {
- if (options.inRepoAddon) {
- return path.join('lib', options.inRepoAddon, 'addon');
- }
-
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'app');
- }
-
- if (options.inAddon) {
- return 'addon';
- }
-
- return 'app';
- },
- };
- }
+ }
+ return options.locals.moduleName;
+ },
+ __root__(options) {
+ if (options.inRepoAddon) {
+ return path.join('lib', options.inRepoAddon, 'addon');
+ }
+
+ if (options.inDummy) {
+ return path.join('tests', 'dummy', 'app');
+ }
+
+ if (options.inAddon) {
+ return 'addon';
+ }
+
+ return 'app';
+ },
+ };
},
- locals: function(options) {
+ locals: function (options) {
let moduleName = options.entity.name;
+ let rawRouteName = moduleName.split('/').pop();
+ let emberPageTitleExists = 'ember-page-title' in options.project.dependencies();
+ let hasDynamicSegment = options.path && options.path.includes(':');
if (options.resetNamespace) {
- moduleName = moduleName.split('/').pop();
+ moduleName = rawRouteName;
}
return {
moduleName: stringUtil.dasherize(moduleName),
+ routeName: stringUtil.classify(rawRouteName),
+ addTitle: emberPageTitleExists,
+ hasDynamicSegment,
};
},
- shouldEntityTouchRouter: function(name) {
+ shouldEntityTouchRouter: function (name) {
let isIndex = name === 'index';
let isBasic = name === 'basic';
let isApplication = name === 'application';
@@ -118,7 +106,7 @@ module.exports = useEditionDetector({
return !isBasic && !isIndex && !isApplication;
},
- shouldTouchRouter: function(name, options) {
+ shouldTouchRouter: function (name, options) {
let entityTouchesRouter = this.shouldEntityTouchRouter(name);
let isDummy = Boolean(options.dummy);
let isAddon = Boolean(options.project.isEmberCLIAddon());
@@ -133,17 +121,17 @@ module.exports = useEditionDetector({
);
},
- afterInstall: function(options) {
+ afterInstall: function (options) {
updateRouter.call(this, 'add', options);
},
- afterUninstall: function(options) {
+ afterUninstall: function (options) {
updateRouter.call(this, 'remove', options);
},
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
},
-});
+};
function updateRouter(action, options) {
let entity = options.entity;
@@ -161,21 +149,42 @@ function updateRouter(action, options) {
}
}
-function findRouter(options) {
+function findRouterPath(options) {
let routerPathParts = [options.project.root];
- let root = isModuleUnificationProject(options.project) ? 'src' : 'app';
if (options.dummy && options.project.isEmberCLIAddon()) {
- routerPathParts = routerPathParts.concat(['tests', 'dummy', root, 'router.js']);
+ routerPathParts.push('tests', 'dummy', 'app');
} else {
- routerPathParts = routerPathParts.concat([root, 'router.js']);
+ routerPathParts.push('app');
+ }
+
+ let jsRouterPath = path.join(...routerPathParts, 'router.js');
+ let tsRouterPath = path.join(...routerPathParts, 'router.ts');
+
+ let jsRouterPathExists = fs.existsSync(jsRouterPath);
+ let tsRouterPathExists = fs.existsSync(tsRouterPath);
+
+ if (jsRouterPathExists && tsRouterPathExists) {
+ throw new SilentError(
+ 'Found both a `router.js` and `router.ts` file. Please make sure your project only has one or the other.'
+ );
+ }
+
+ if (jsRouterPathExists) {
+ return jsRouterPath;
+ }
+
+ if (tsRouterPathExists) {
+ return tsRouterPath;
}
- return routerPathParts;
+ throw new SilentError(
+ 'Could not find a router file. Please make sure your project has a `router.js` or `router.ts` file.'
+ );
}
function writeRoute(action, name, options) {
- let routerPath = path.join.apply(null, findRouter(options));
+ let routerPath = findRouterPath(options);
let source = fs.readFileSync(routerPath, 'utf-8');
let routes = new EmberRouterGenerator(source);
diff --git a/blueprints/route/native-files/__root__/__path__/__name__.js b/blueprints/route/native-files/__root__/__path__/__name__.js
deleted file mode 100644
index 508c4dbe00c..00000000000
--- a/blueprints/route/native-files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Route from '@ember/routing/route';
-
-export default class <%= classifiedModuleName %>Route extends Route {
-}
diff --git a/blueprints/route/native-files/__root__/__templatepath__/__templatename__.hbs b/blueprints/route/native-files/__root__/__templatepath__/__templatename__.hbs
deleted file mode 100644
index e2147cab02d..00000000000
--- a/blueprints/route/native-files/__root__/__templatepath__/__templatename__.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{outlet}}
\ No newline at end of file
diff --git a/blueprints/service-test/index.js b/blueprints/service-test/index.js
index cfe1c361ebc..0dd10e1f9b0 100644
--- a/blueprints/service-test/index.js
+++ b/blueprints/service-test/index.js
@@ -1,39 +1,33 @@
'use strict';
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
module.exports = useTestFrameworkDetector({
description: 'Generates a service unit test.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
- return 'src';
- },
- __testType__() {
- return '';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return 'unit';
- },
- };
- }
+ fileMapTokens() {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return 'unit';
+ },
+ };
},
locals(options) {
return {
+ modulePrefix: modulePrefixForProject(options.project),
friendlyTestDescription: ['Unit', 'Service', options.entity.name].join(' | '),
};
},
diff --git a/blueprints/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js b/blueprints/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
index b04821213a9..dde1fd8b11c 100644
--- a/blueprints/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/service-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('<%= friendlyTestDescription %>', function() {
+describe('<%= friendlyTestDescription %>', function () {
setupTest('service:<%= dasherizedModuleName %>', {
// Specify the other units that are required for this test.
// needs: ['service:foo']
});
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let service = this.subject();
expect(service).to.be.ok;
});
diff --git a/blueprints/service-test/mocha-files/__root__/__testType__/__path__/__test__.js b/blueprints/service-test/mocha-files/__root__/__testType__/__path__/__test__.js
index 53638511c68..2954042d0d0 100644
--- a/blueprints/service-test/mocha-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/service-test/mocha-files/__root__/__testType__/__path__/__test__.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('service:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>',
+describeModule(
+ 'service:<%= dasherizedModuleName %>',
+ '<%= friendlyTestDescription %>',
{
// Specify the other units that are required for this test.
// needs: ['service:foo']
},
- function() {
+ function () {
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let service = this.subject();
expect(service).to.be.ok;
});
diff --git a/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index ca0b4e65955..00000000000
--- a/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
-
-describe('<%= friendlyTestDescription %>', function() {
- setupTest();
-
- // TODO: Replace this with your real tests.
- it('exists', function() {
- let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
- expect(service).to.be.ok;
- });
-});
diff --git a/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..2124d8d45fa
--- /dev/null
+++ b/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+describe('<%= friendlyTestDescription %>', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
+ expect(service).to.be.ok;
+ });
+});
diff --git a/blueprints/service-test/qunit-files/__root__/__testType__/__path__/__test__.js b/blueprints/service-test/qunit-files/__root__/__testType__/__path__/__test__.js
index 203b9d24aa8..1f42bc8820f 100644
--- a/blueprints/service-test/qunit-files/__root__/__testType__/__path__/__test__.js
+++ b/blueprints/service-test/qunit-files/__root__/__testType__/__path__/__test__.js
@@ -6,7 +6,7 @@ moduleFor('service:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let service = this.subject();
assert.ok(service);
});
diff --git a/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js b/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
deleted file mode 100644
index 5904acff9b5..00000000000
--- a/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('<%= friendlyTestDescription %>', function(hooks) {
- setupTest(hooks);
-
- // TODO: Replace this with your real tests.
- test('it exists', function(assert) {
- let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
- assert.ok(service);
- });
-});
diff --git a/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts b/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
new file mode 100644
index 00000000000..14ec42e38ad
--- /dev/null
+++ b/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from '<%= modulePrefix %>/tests/helpers';
+
+module('<%= friendlyTestDescription %>', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
+ assert.ok(service);
+ });
+});
diff --git a/blueprints/service/files/__root__/__path__/__name__.js b/blueprints/service/files/__root__/__path__/__name__.js
deleted file mode 100644
index 2c0547143aa..00000000000
--- a/blueprints/service/files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Service from '@ember/service';
-
-export default Service.extend({
-});
diff --git a/blueprints/service/files/__root__/__path__/__name__.ts b/blueprints/service/files/__root__/__path__/__name__.ts
new file mode 100644
index 00000000000..d1685868023
--- /dev/null
+++ b/blueprints/service/files/__root__/__path__/__name__.ts
@@ -0,0 +1,13 @@
+import Service from '@ember/service';
+
+export default class <%= classifiedModuleName %>Service extends Service {}
+
+// Don't remove this declaration: this is what enables TypeScript to resolve
+// this service using `Owner.lookup('service:<%= dasherizedModuleName %>')`, as well
+// as to check when you pass the service name as an argument to the decorator,
+// like `@service('<%= dasherizedModuleName %>') declare altName: <%= classifiedModuleName %>Service;`.
+declare module '@ember/service' {
+ interface Registry {
+ '<%= dasherizedModuleName %>': <%= classifiedModuleName %>Service;
+ }
+}
diff --git a/blueprints/service/index.js b/blueprints/service/index.js
index 031b5a979ce..a5c8a75d545 100644
--- a/blueprints/service/index.js
+++ b/blueprints/service/index.js
@@ -1,30 +1,18 @@
'use strict';
-const path = require('path');
-const useEditionDetector = require('../edition-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
-module.exports = useEditionDetector({
+module.exports = {
description: 'Generates a service.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
+ shouldTransformTypeScript: true,
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
-
- return 'src';
- },
- };
- }
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
- normalizeEntityName: function(entityName) {
+
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
},
-});
+};
diff --git a/blueprints/service/native-files/__root__/__path__/__name__.js b/blueprints/service/native-files/__root__/__path__/__name__.js
deleted file mode 100644
index c79f7d69641..00000000000
--- a/blueprints/service/native-files/__root__/__path__/__name__.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Service from '@ember/service';
-
-export default class <%= classifiedModuleName %>Service extends Service {
-}
diff --git a/blueprints/template/index.js b/blueprints/template/index.js
index d4db3cb1805..3d060fc826e 100644
--- a/blueprints/template/index.js
+++ b/blueprints/template/index.js
@@ -1,34 +1,8 @@
'use strict';
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
-
module.exports = {
description: 'Generates a template.',
-
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- } else if (options.inDummy) {
- return 'tests/dummy/src/ui/routes';
- } else {
- return 'src/ui/routes';
- }
- },
-
- __path__(options) {
- return options.dasherizedModuleName;
- },
-
- __name__() {
- return 'template';
- },
- };
- }
- },
- normalizeEntityName: function(entityName) {
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.hbs$/, ''); //Prevent generation of ".hbs.hbs" files
},
};
diff --git a/blueprints/test-framework-detector.js b/blueprints/test-framework-detector.js
index eedef9e3049..a294a911dfb 100644
--- a/blueprints/test-framework-detector.js
+++ b/blueprints/test-framework-detector.js
@@ -4,44 +4,47 @@ const fs = require('fs');
const path = require('path');
const VersionChecker = require('ember-cli-version-checker');
-module.exports = function(blueprint) {
- blueprint.supportsAddon = function() {
+module.exports = function (blueprint) {
+ blueprint.supportsAddon = function () {
return false;
};
- blueprint.filesPath = function() {
+ blueprint.filesPath = function () {
let type;
+ const qunitRfcVersion = 'qunit-rfc-232';
+ const mochaRfcVersion = 'mocha-rfc-232';
+ const mochaVersion = 'mocha-0.12';
let dependencies = this.project.dependencies();
if ('ember-qunit' in dependencies) {
- type = 'qunit-rfc-232';
+ type = qunitRfcVersion;
} else if ('ember-cli-qunit' in dependencies) {
let checker = new VersionChecker(this.project);
if (
- fs.existsSync(this.path + '/qunit-rfc-232-files') &&
+ fs.existsSync(`${this.path}/${qunitRfcVersion}-files`) &&
checker.for('ember-cli-qunit', 'npm').gte('4.2.0')
) {
- type = 'qunit-rfc-232';
+ type = qunitRfcVersion;
} else {
type = 'qunit';
}
} else if ('ember-mocha' in dependencies) {
let checker = new VersionChecker(this.project);
if (
- fs.existsSync(this.path + '/mocha-rfc-232-files') &&
+ fs.existsSync(`${this.path}/${mochaRfcVersion}-files`) &&
checker.for('ember-mocha', 'npm').gte('0.14.0')
) {
- type = 'mocha-rfc-232';
+ type = mochaRfcVersion;
} else {
- type = 'mocha-0.12';
+ type = mochaVersion;
}
} else if ('ember-cli-mocha' in dependencies) {
let checker = new VersionChecker(this.project);
if (
- fs.existsSync(this.path + '/mocha-0.12-files') &&
+ fs.existsSync(`${this.path}/${mochaVersion}-files`) &&
checker.for('ember-cli-mocha', 'npm').gte('0.12.0')
) {
- type = 'mocha-0.12';
+ type = mochaVersion;
} else {
type = 'mocha';
}
diff --git a/blueprints/util-test/index.js b/blueprints/util-test/index.js
index 28f283435c6..ebc7e416402 100644
--- a/blueprints/util-test/index.js
+++ b/blueprints/util-test/index.js
@@ -1,44 +1,36 @@
'use strict';
-const stringUtils = require('ember-cli-string-utils');
const path = require('path');
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
+const { modulePrefixForProject } = require('../-utils');
const useTestFrameworkDetector = require('../test-framework-detector');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
module.exports = useTestFrameworkDetector({
description: 'Generates a util unit test.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
+ shouldTransformTypeScript: true,
+
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
+ },
- return 'src';
- },
- __testType__() {
- return 'utils';
- },
- };
- } else {
- return {
- __root__() {
- return 'tests';
- },
- __testType__() {
- return path.join('unit', 'utils');
- },
- };
- }
+ fileMapTokens() {
+ return {
+ __root__() {
+ return 'tests';
+ },
+ __testType__() {
+ return path.join('unit', 'utils');
+ },
+ };
},
- locals: function(options) {
+ locals: function (options) {
return {
friendlyTestName: ['Unit', 'Utility', options.entity.name].join(' | '),
- dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix),
+ modulePrefix: modulePrefixForProject(options.project),
};
},
});
diff --git a/blueprints/util-test/mocha-files/__root__/__testType__/__name__-test.js b/blueprints/util-test/mocha-files/__root__/__testType__/__name__-test.js
index de9e098806b..8d06bcc0413 100644
--- a/blueprints/util-test/mocha-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/util-test/mocha-files/__root__/__testType__/__name__-test.js
@@ -2,9 +2,9 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';
-describe('<%= friendlyTestName %>', function() {
+describe('<%= friendlyTestName %>', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let result = <%= camelizedModuleName %>();
expect(result).to.be.ok;
});
diff --git a/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
deleted file mode 100644
index de9e098806b..00000000000
--- a/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';
-
-describe('<%= friendlyTestName %>', function() {
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = <%= camelizedModuleName %>();
- expect(result).to.be.ok;
- });
-});
diff --git a/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.ts b/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.ts
new file mode 100644
index 00000000000..8d06bcc0413
--- /dev/null
+++ b/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/__name__-test.ts
@@ -0,0 +1,11 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';
+
+describe('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ it('works', function () {
+ let result = <%= camelizedModuleName %>();
+ expect(result).to.be.ok;
+ });
+});
diff --git a/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js b/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js
index 9eeb7fa4bc3..2a10306510e 100644
--- a/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js
+++ b/blueprints/util-test/qunit-files/__root__/__testType__/__name__-test.js
@@ -1,10 +1,10 @@
-import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
+import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
module('<%= friendlyTestName %>');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = <%= camelizedModuleName %>();
assert.ok(result);
});
diff --git a/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js b/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
deleted file mode 100644
index 124b6a2368a..00000000000
--- a/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
-import { module, test } from 'qunit';
-
-module('<%= friendlyTestName %>', function() {
-
- // TODO: Replace this with your real tests.
- test('it works', function(assert) {
- let result = <%= camelizedModuleName %>();
- assert.ok(result);
- });
-});
diff --git a/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.ts b/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.ts
new file mode 100644
index 00000000000..0278e54bdfb
--- /dev/null
+++ b/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/__name__-test.ts
@@ -0,0 +1,10 @@
+import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
+import { module, test } from 'qunit';
+
+module('<%= friendlyTestName %>', function () {
+ // TODO: Replace this with your real tests.
+ test('it works', function (assert) {
+ let result = <%= camelizedModuleName %>();
+ assert.ok(result);
+ });
+});
diff --git a/blueprints/util/files/__root__/utils/__name__.ts b/blueprints/util/files/__root__/utils/__name__.ts
new file mode 100644
index 00000000000..ab636c1792a
--- /dev/null
+++ b/blueprints/util/files/__root__/utils/__name__.ts
@@ -0,0 +1,3 @@
+export default function <%= camelizedModuleName %>() {
+ return true;
+}
diff --git a/blueprints/util/index.js b/blueprints/util/index.js
index 5c741a18a00..69cb5d58df5 100644
--- a/blueprints/util/index.js
+++ b/blueprints/util/index.js
@@ -1,32 +1,18 @@
'use strict';
-const path = require('path');
-const isModuleUnificationProject = require('../module-unification').isModuleUnificationProject;
+const maybePolyfillTypeScriptBlueprints = require('../-maybe-polyfill-typescript-blueprints');
module.exports = {
description: 'Generates a simple utility module/function.',
- fileMapTokens() {
- if (isModuleUnificationProject(this.project)) {
- return {
- __root__(options) {
- if (options.pod) {
- throw new Error("Pods aren't supported within a module unification app");
- }
+ shouldTransformTypeScript: true,
- if (options.inDummy) {
- return path.join('tests', 'dummy', 'src');
- }
-
- return 'src';
- },
- __testType__() {
- return '';
- },
- };
- }
+ init() {
+ this._super && this._super.init.apply(this, arguments);
+ maybePolyfillTypeScriptBlueprints(this);
},
- normalizeEntityName: function(entityName) {
+
+ normalizeEntityName: function (entityName) {
return entityName.replace(/\.js$/, ''); //Prevent generation of ".js.js" files
},
};
diff --git a/broccoli/babel-helpers.js b/broccoli/babel-helpers.js
index 9d4818114f0..cbc20d8855d 100644
--- a/broccoli/babel-helpers.js
+++ b/broccoli/babel-helpers.js
@@ -2,7 +2,7 @@
const Funnel = require('broccoli-funnel');
-module.exports = function() {
+module.exports = function () {
return new Funnel('packages/external-helpers/lib', {
files: ['external-helpers.js'],
getDestinationPath() {
diff --git a/broccoli/build-info.js b/broccoli/build-info.js
index e611bb3f39c..98e77db0919 100644
--- a/broccoli/build-info.js
+++ b/broccoli/build-info.js
@@ -20,12 +20,7 @@ function buildInfo(options) {
let root = (options && options.root) || path.resolve(__dirname, '..');
let packageVersion = (options && options.packageVersion) || readPackageVersion(root);
let gitInfo = (options && options.gitInfo) || buildGitInfo(root);
- let buildInfo = buildFromParts(
- packageVersion,
- gitInfo,
- process.env.TRAVIS,
- process.env.TRAVIS_BRANCH
- );
+ let buildInfo = buildFromParts(packageVersion, gitInfo);
if (!options) {
cached = buildInfo;
}
@@ -75,47 +70,44 @@ function buildGitInfo(root) {
* Build info object from parts.
* @param {string} packageVersion
* @param {GitInfo} gitInfo
- * @param {boolean} isCI
- * @param {string} travisBranch
* @returns {BuildInfo}
*/
-function buildFromParts(packageVersion, gitInfo, isCI = false, travisBranch = '') {
+function buildFromParts(packageVersion, gitInfo) {
let { tag, branch, sha } = gitInfo;
-
- let tagVersion = parseTagVersion(tag);
let shortSha = sha.slice(0, 8);
- branch = travisBranch || branch; // Travis builds are always detached
- let channel =
- branch === 'master'
- ? process.env.BUILD_TYPE === 'alpha'
- ? 'alpha'
- : 'canary'
- : branch && escapeSemVerIdentifier(branch);
-
- let isBuildForTag = isTagBuild(tag, branch, isCI);
- let version = isBuildForTag ? tagVersion : buildVersion(packageVersion, shortSha, channel);
-
- return {
- tag,
- branch,
- sha,
- shortSha,
- channel,
- packageVersion,
- tagVersion,
- version,
- isBuildForTag,
- };
-}
-
-function isTagBuild(tag, branch, isCI) {
- if (!tag) {
- return false;
+ if (tag) {
+ let tagVersion = parseTagVersion(tag);
+ return {
+ tag,
+ branch: null,
+ sha,
+ shortSha,
+ channel: 'tag',
+ packageVersion,
+ tagVersion,
+ version: tagVersion,
+ isBuildForTag: true,
+ };
+ } else {
+ let channel =
+ branch === 'master'
+ ? process.env.BUILD_TYPE === 'alpha'
+ ? 'alpha'
+ : 'canary'
+ : branch && escapeSemVerIdentifier(branch);
+ let version = buildVersion(packageVersion, shortSha, channel);
+ return {
+ tag: null,
+ branch,
+ sha,
+ shortSha,
+ channel,
+ packageVersion,
+ tagVersion: null,
+ version,
+ isBuildForTag: false,
+ };
}
- if (isCI) {
- return branch === tag;
- }
- return true;
}
/**
@@ -133,11 +125,7 @@ function readPackageVersion(root) {
* @param {string} tag
*/
function parseTagVersion(tag) {
- try {
- return tag && semver.parse(tag).version;
- } catch (e) {
- return;
- }
+ return tag && semver.parse(tag).version;
}
/**
@@ -182,4 +170,3 @@ module.exports.buildInfo = buildInfo;
module.exports.buildFromParts = buildFromParts;
module.exports.buildVersion = buildVersion;
module.exports.parseTagVersion = parseTagVersion;
-module.exports.isTagBuild = isTagBuild;
diff --git a/broccoli/deprecated-features.js b/broccoli/deprecated-features.js
index 743c974812d..f8073718f02 100644
--- a/broccoli/deprecated-features.js
+++ b/broccoli/deprecated-features.js
@@ -21,10 +21,10 @@ const DEPRECATED_FEATURES = (function getFeatures() {
let sourceFile = ts.createSourceFile(fileName, contents, ts.ScriptTarget.ES2017);
let flags = {};
- sourceFile.statements.forEach(statement => {
+ sourceFile.statements.forEach((statement) => {
if (
statement.kind === ts.SyntaxKind.VariableStatement &&
- statement.modifiers.some(m => m.kind === ts.SyntaxKind.ExportKeyword)
+ statement.modifiers.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)
) {
handleExportedDeclaration(statement, flags);
}
diff --git a/broccoli/glimmer-template-compiler.js b/broccoli/glimmer-template-compiler.js
index 5baa7f8551b..be6361d25f0 100644
--- a/broccoli/glimmer-template-compiler.js
+++ b/broccoli/glimmer-template-compiler.js
@@ -22,17 +22,17 @@ function GlimmerTemplatePrecompiler(inputTree, options) {
GlimmerTemplatePrecompiler.prototype.extensions = ['hbs'];
GlimmerTemplatePrecompiler.prototype.targetExtension = 'js';
-GlimmerTemplatePrecompiler.prototype.baseDir = function() {
+GlimmerTemplatePrecompiler.prototype.baseDir = function () {
return __dirname;
};
-GlimmerTemplatePrecompiler.prototype.processString = function(content, relativePath) {
+GlimmerTemplatePrecompiler.prototype.processString = function (content, relativePath) {
let compiled = this.precompile(content, {
meta: { moduleName: relativePath },
});
return stripIndent`
- import template from '../template';
- export default template(${compiled});
+ import { templateFactory } from '@glimmer/opcode-compiler';
+ export default templateFactory(${compiled});
`;
};
diff --git a/broccoli/package-json-writer.js b/broccoli/package-json-writer.js
index c00c8f286b0..4e6e6a746ae 100644
--- a/broccoli/package-json-writer.js
+++ b/broccoli/package-json-writer.js
@@ -26,9 +26,9 @@ module.exports = class PackageJSONWriter extends Plugin {
build() {
let packages = this.discoverPackages();
- packages.forEach(packageName => {
+ packages.forEach((packageName) => {
this.writeMainPackageJson(packageName);
- this.discoverEntryPoints(packageName).forEach(entryPoint => {
+ this.discoverEntryPoints(packageName).forEach((entryPoint) => {
this.writeEntryPointPackageJson(packageName, entryPoint);
});
});
@@ -53,11 +53,11 @@ module.exports = class PackageJSONWriter extends Plugin {
*/
discoverEntryPoints(packageName) {
let files = this.glob(`${packageName}/!(index).js`)
- .map(file => path.basename(file, '.js'))
- .map(file => [file, true]);
+ .map((file) => path.basename(file, '.js'))
+ .map((file) => [file, true]);
let directories = this.glob(`${packageName}/!(lib|tests)/`)
- .map(file => path.basename(file))
- .map(file => [file, false]);
+ .map((file) => path.basename(file))
+ .map((file) => [file, false]);
return [...files, ...directories];
}
diff --git a/broccoli/packages.js b/broccoli/packages.js
index 543de0ecd77..7c19582105f 100644
--- a/broccoli/packages.js
+++ b/broccoli/packages.js
@@ -1,11 +1,10 @@
'use strict';
-const { readFileSync, existsSync } = require('fs');
+const { existsSync } = require('fs');
const path = require('path');
const Rollup = require('broccoli-rollup');
const Funnel = require('broccoli-funnel');
const MergeTrees = require('broccoli-merge-trees');
-const Babel = require('broccoli-babel-transpiler');
const typescript = require('broccoli-typescript-compiler').default;
const BroccoliDebug = require('broccoli-debug');
const findLib = require('./find-lib');
@@ -18,7 +17,6 @@ const StringReplace = require('broccoli-string-replace');
const GlimmerTemplatePrecompiler = require('./glimmer-template-compiler');
const VERSION_PLACEHOLDER = /VERSION_STRING_PLACEHOLDER/g;
const canaryFeatures = require('./canary-features');
-const injectNodeGlobals = require('./transforms/inject-node-globals');
const debugTree = BroccoliDebug.buildDebugCallback('ember-source');
@@ -36,15 +34,7 @@ module.exports.routerES = function _routerES() {
});
};
-module.exports.jquery = function _jquery() {
- return new Funnel(findLib('jquery'), {
- files: ['jquery.js'],
- destDir: 'jquery',
- annotation: 'jquery',
- });
-};
-
-module.exports.internalLoader = function _internalLoader() {
+module.exports.loader = function _loader() {
return new Funnel('packages/loader/lib', {
files: ['index.js'],
getDestinationPath() {
@@ -118,38 +108,19 @@ module.exports.getPackagesES = function getPackagesES() {
};
module.exports.handlebarsES = function _handlebars() {
- return new Rollup(findLib('handlebars', 'lib'), {
- annotation: 'handlebars',
+ return new Rollup(findLib('@handlebars/parser', 'dist/esm'), {
+ annotation: '@handlebars/parser',
rollup: {
- input: 'handlebars/compiler/base.js',
+ input: 'index.js',
output: {
- file: 'handlebars.js',
+ file: '@handlebars/parser/index.js',
format: 'es',
exports: 'named',
},
- plugins: [handlebarsFix()],
},
});
};
-function handlebarsFix() {
- let HANDLEBARS_PARSER = /[/\\]parser.js$/;
- return {
- load: function(id) {
- if (HANDLEBARS_PARSER.test(id)) {
- let code = readFileSync(id, 'utf8');
- return {
- code: code
- .replace('exports.__esModule = true;', '')
- .replace("exports['default'] = handlebars;", 'export default handlebars;'),
-
- map: { mappings: null },
- };
- }
- },
- };
-}
-
module.exports.rsvpES = function _rsvpES() {
let lib = path.resolve(path.dirname(require.resolve('rsvp')), '../lib');
return new Rollup(lib, {
@@ -253,6 +224,7 @@ function glimmerTrees(entries) {
let trees = [];
let queue = Array.isArray(entries) ? entries.slice() : [entries];
let name;
+
while ((name = queue.pop()) !== undefined) {
if (seen.has(name)) {
continue;
@@ -274,14 +246,8 @@ function glimmerTrees(entries) {
queue.push(...dependencies);
}
}
- return new Babel(new MergeTrees(trees), {
- sourceMaps: true,
- plugins: [
- // ensures `@glimmer/compiler` requiring `crypto` works properly
- // in both browser and node-land
- injectNodeGlobals,
- ],
- });
+
+ return new MergeTrees(trees);
}
module.exports.glimmerCompilerES = () => {
@@ -292,6 +258,9 @@ module.exports.glimmerES = function glimmerES(environment) {
let glimmerEntries = [
'@glimmer/node',
'@simple-dom/document',
+ '@glimmer/manager',
+ '@glimmer/destroyable',
+ '@glimmer/owner',
'@glimmer/opcode-compiler',
'@glimmer/runtime',
];
diff --git a/broccoli/test-polyfills.js b/broccoli/test-polyfills.js
deleted file mode 100644
index 1acff85794e..00000000000
--- a/broccoli/test-polyfills.js
+++ /dev/null
@@ -1,27 +0,0 @@
-const Rollup = require('broccoli-rollup');
-const writeFile = require('broccoli-file-creator');
-const resolve = require('rollup-plugin-node-resolve');
-const commonjs = require('rollup-plugin-commonjs');
-
-module.exports = function polyfills() {
- let polyfillEntry = writeFile(
- 'polyfill-entry.js',
- `
- require('core-js/modules/es6.promise');
- require('core-js/modules/es6.symbol');
- require('regenerator-runtime/runtime');
- `
- );
-
- return new Rollup(polyfillEntry, {
- rollup: {
- input: 'polyfill-entry.js',
- output: {
- file: 'polyfill.js',
- name: 'polyfill',
- format: 'iife',
- },
- plugins: [resolve(), commonjs()],
- },
- });
-};
diff --git a/broccoli/transforms/inject-node-globals.js b/broccoli/transforms/inject-node-globals.js
deleted file mode 100644
index 5ead4a3d799..00000000000
--- a/broccoli/transforms/inject-node-globals.js
+++ /dev/null
@@ -1,52 +0,0 @@
-function injectNodeGlobals({ types: t }) {
- let requireId;
- let importDecl;
- let moduleId;
- return {
- name: 'inject require',
- visitor: {
- Program: {
- enter(path, state) {
- if (state.file.opts.filename.match(/node-module\/index.js/)) return;
-
- requireId = path.scope.globals.require;
- moduleId = path.scope.globals.module;
-
- if (requireId || moduleId) {
- let specifiers = [];
- let source = t.stringLiteral('node-module');
-
- if (requireId) {
- delete path.scope.globals.require;
- specifiers.push(t.importSpecifier(requireId, t.identifier('require')));
- }
-
- if (moduleId) {
- delete path.scope.globals.module;
- specifiers.push(t.importSpecifier(moduleId, t.identifier('module')));
- }
-
- importDecl = t.importDeclaration(specifiers, source);
- path.unshiftContainer('body', importDecl);
- }
- },
- exit(path) {
- if (requireId) {
- path.scope.rename('require');
- }
- },
- },
- ImportDeclaration(path) {
- if (path.node === importDecl) {
- path.scope.registerDeclaration(path);
- }
- },
- },
- };
-}
-
-injectNodeGlobals.baseDir = function() {
- return 'babel-plugin-transform-es2015-modules-amd';
-};
-
-module.exports = injectNodeGlobals;
diff --git a/config/browserlists.js b/config/browserlists.js
index ec586851a0c..60fc7020059 100644
--- a/config/browserlists.js
+++ b/config/browserlists.js
@@ -1,10 +1,4 @@
-const allSupportedBrowsers = [
- 'last 2 Chrome versions',
- 'last 2 Firefox versions',
- 'last 2 Safari versions',
- 'last 2 Edge versions',
- 'ie 11',
-];
+const allSupportedBrowsers = require('../lib/browsers');
const modernBrowsers = [
'last 1 Chrome versions',
diff --git a/config/targets.js b/config/targets.js
index 5a831d045e1..16827078166 100644
--- a/config/targets.js
+++ b/config/targets.js
@@ -6,4 +6,5 @@ const shouldTranspile = Boolean(process.env.SHOULD_TRANSPILE);
module.exports = {
browsers: isProduction || shouldTranspile ? allSupportedBrowsers : modernBrowsers,
+ ...(process.env.SHOULD_TRANSPILE_FOR_NODE ? { node: 'current' } : undefined),
};
diff --git a/d8-app.js b/d8-app.js
index 0b237bfc513..0e1738f711b 100644
--- a/d8-app.js
+++ b/d8-app.js
@@ -5,8 +5,8 @@ let Router = Ember.Router.extend({
location: 'none',
rootURL: '/',
});
-Router.map(function() {
- this.route('my-route', { path: '/my-route' }, function() {});
+Router.map(function () {
+ this.route('my-route', { path: '/my-route' }, function () {});
});
Ember.TEMPLATES['index'] = Ember.HTMLBars.template({
id: null,
@@ -35,19 +35,19 @@ let options = {
};
app
.visit('/', options)
- .then(function(instance) {
+ .then(function (instance) {
print(serializer.serialize(doc.body));
let router = instance.lookup('router:main');
return router.transitionTo('/my-route');
})
- .then(function() {
- return new Ember.RSVP.Promise(function(resolve) {
+ .then(function () {
+ return new Ember.RSVP.Promise(function (resolve) {
Ember.run.schedule('afterRender', resolve);
});
})
- .then(function() {
+ .then(function () {
print(serializer.serialize(doc.body));
})
- .catch(function(err) {
+ .catch(function (err) {
print(err.stack);
});
diff --git a/d8-runner.js b/d8-runner.js
index 1234ce41ef6..18fa7de7223 100644
--- a/d8-runner.js
+++ b/d8-runner.js
@@ -52,11 +52,11 @@ global.console = {
},
};
-global.setTimeout = function(callback) {
+global.setTimeout = function (callback) {
// good enough
Promise.resolve()
.then(callback)
- .catch(e => print('error' + e));
+ .catch((e) => print('error' + e));
};
loadFile('./node_modules/simple-dom/dist/simple-dom.js');
diff --git a/ember-cli-build.js b/ember-cli-build.js
index 64f0b7d1aa5..76932bd8232 100644
--- a/ember-cli-build.js
+++ b/ember-cli-build.js
@@ -5,7 +5,6 @@ const Funnel = require('broccoli-funnel');
const babelHelpers = require('./broccoli/babel-helpers');
const concatBundle = require('./lib/concat-bundle');
const testIndexHTML = require('./broccoli/test-index-html');
-const testPolyfills = require('./broccoli/test-polyfills');
const rollupPackage = require('./broccoli/rollup-package');
const minify = require('./broccoli/minify');
const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:ember-cli-build');
@@ -14,8 +13,7 @@ Error.stackTraceLimit = Infinity;
const {
routerES,
- jquery,
- internalLoader,
+ loader,
qunit,
handlebarsES,
rsvpES,
@@ -60,8 +58,8 @@ function withTargets(project, fn) {
};
}
-module.exports = function({ project }) {
- let emberSource = project.addons.find(a => a.name === 'ember-source');
+module.exports = function ({ project }) {
+ let emberSource = project.addons.find((a) => a.name === 'ember-source');
let transpileTree = withTargets(project, emberSource.transpileTree.bind(emberSource));
let emberBundles = withTargets(project, emberSource.buildEmberBundles.bind(emberSource));
@@ -120,6 +118,9 @@ module.exports = function({ project }) {
'@ember/-internals/*/tests/**' /* internal packages */,
'*/*/tests/**' /* scoped packages */,
'*/tests/**' /* packages */,
+ '@ember/-internals/*/type-tests/**' /* internal packages */,
+ '*/*/type-tests/**' /* scoped packages */,
+ '*/type-tests/**' /* packages */,
'ember-template-compiler/**',
'internal-test-helpers/**',
],
@@ -230,6 +231,8 @@ function templateCompilerBundle(emberPackages, transpileTree) {
'@ember/-internals/*/tests/**' /* internal packages */,
'*/*/tests/**' /* scoped packages */,
'*/tests/**' /* packages */,
+ '*/*/type-tests/**' /* scoped packages */,
+ '*/type-tests/**' /* packages */,
],
}),
templateCompilerDependencies(),
@@ -246,7 +249,7 @@ function templateCompilerBundle(emberPackages, transpileTree) {
}
function testHarness() {
- return new MergeTrees([emptyTestem(), testPolyfills(), testIndexHTML(), qunit(), jquery()]);
+ return new MergeTrees([emptyTestem(), testIndexHTML(), loader(), qunit()]);
}
function emptyTestem() {
@@ -262,5 +265,5 @@ function templateCompilerDependencies() {
}
function emberHeaderFiles() {
- return new MergeTrees([emberLicense(), internalLoader()]);
+ return new MergeTrees([emberLicense(), loader()]);
}
diff --git a/generators/license.js b/generators/license.js
index a22609bbb47..c97c872c009 100644
--- a/generators/license.js
+++ b/generators/license.js
@@ -1,6 +1,6 @@
/*!
* @overview Ember - JavaScript Application Framework
- * @copyright Copyright 2011-2020 Tilde Inc. and contributors
+ * @copyright Copyright 2011 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
diff --git a/lib/browsers.js b/lib/browsers.js
new file mode 100644
index 00000000000..c4f65b92ddb
--- /dev/null
+++ b/lib/browsers.js
@@ -0,0 +1,50 @@
+module.exports = [
+ 'Chrome >= 92',
+ 'Edge >= 93',
+ 'Firefox >= 91',
+ 'iOS >= 12',
+ 'Safari >= 12',
+ 'ChromeAndroid >= 96',
+ 'FirefoxAndroid >= 94',
+];
+
+/*
+ As of the release of 4.0.0, the above query expands to:
+
+ and_chr 96
+ and_ff 94
+ chrome 96
+ chrome 95
+ chrome 94
+ chrome 93
+ chrome 92
+ chrome 91
+ chrome 87
+ edge 96
+ edge 95
+ firefox 95
+ firefox 94
+ firefox 93
+ firefox 60
+ firefox 52
+ ios_saf 15.2
+ ios_saf 15.0-15.1
+ ios_saf 14.5-14.8
+ ios_saf 14.0-14.4
+ ios_saf 13.4-13.7
+ ios_saf 13.3
+ ios_saf 13.2
+ ios_saf 13.0-13.1
+ ios_saf 12.2-12.5
+ ios_saf 12.0-12.1
+ safari 15.2
+ safari 15.1
+ safari 15
+ safari 14.1
+ safari 14
+ safari 13.1
+ safari 13
+ safari 12.1
+ safari 12
+
+*/
diff --git a/lib/index.js b/lib/index.js
index d1c637a7cce..5a1a043dfb8 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -3,12 +3,15 @@
const MergeTrees = require('broccoli-merge-trees');
const Funnel = require('broccoli-funnel');
const path = require('path');
-const resolve = require('resolve');
const concatBundle = require('./concat-bundle');
const buildDebugMacroPlugin = require('./build-debug-macro-plugin');
const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-plugin');
-const injectBabelHelpers = require('./transforms/inject-babel-helpers');
+const injectBabelHelpers = require('./transforms/inject-babel-helpers').injectBabelHelpers;
const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:addon');
+const vmBabelPlugins = require('@glimmer/vm-babel-plugins');
+const Overrides = require('./overrides');
+const SilentError = require('silent-error');
+const SupportedBrowsers = require('./browsers');
const PRE_BUILT_TARGETS = [
'last 1 Chrome versions',
@@ -22,7 +25,7 @@ const absolutePaths = {};
function add(paths, name, path) {
Object.defineProperty(paths, name, {
configurable: false,
- get: function() {
+ get: function () {
return path;
},
});
@@ -31,7 +34,6 @@ function add(paths, name, path) {
add(paths, 'prod', 'vendor/ember/ember.js');
add(paths, 'debug', 'vendor/ember/ember.js');
add(paths, 'testing', 'vendor/ember/ember-testing.js');
-add(paths, 'jquery', 'vendor/ember/jquery/jquery.js');
add(
absolutePaths,
@@ -43,13 +45,6 @@ module.exports = {
init() {
this._super.init && this._super.init.apply(this, arguments);
- if ('ember' in this.project.bowerDependencies()) {
- // TODO: move this to a throw soon.
- this.ui.writeWarnLine(
- 'Ember.js is now provided by node_module `ember-source`, please remove it from bower'
- );
- }
-
// resets `this.root` to the correct location by default ember-cli
// considers `__dirname` here to be the root, but since our main entry
// point is within a subfolder we need to correct that
@@ -63,15 +58,30 @@ module.exports = {
name: 'ember-source',
paths,
absolutePaths,
+ _overrideTree: undefined,
+
+ // Expose supported list of browsers for reference by other packages
+ supportedBrowsers: SupportedBrowsers,
included() {
this._super.included.apply(this, arguments);
+ let overrides = Overrides.for(this.project);
+
+ if (overrides.hasOverrides) {
+ this._overrideTree = overrides.toTree();
+ }
+
+ if (overrides.hasBuildTimeWarning) {
+ this.ui.writeWarnLine('[DEPRECATION] ' + overrides.buildTimeWarning);
+ }
+
const { has } = require('@ember/edition-utils');
+ let optionalFeatures = this.project.addons.find((a) => a.name === '@ember/optional-features');
+ let optionalFeaturesMissing = optionalFeatures === undefined;
+
if (has('octane')) {
- let optionalFeatures = this.project.addons.find(a => a.name === '@ember/optional-features');
- let optionalFeaturesMissing = optionalFeatures === undefined;
let message = [];
if (optionalFeaturesMissing) {
@@ -80,25 +90,6 @@ module.exports = {
);
}
- if (
- optionalFeaturesMissing ||
- typeof optionalFeatures.isFeatureExplicitlySet !== 'function'
- ) {
- message.push(
- '* Unable to detect if jquery-integration is explicitly set to a value, please update `@ember/optional-features` to the latest version'
- );
- }
-
- if (
- optionalFeaturesMissing ||
- (typeof optionalFeatures.isFeatureExplicitlySet === 'function' &&
- !optionalFeatures.isFeatureExplicitlySet('jquery-integration'))
- ) {
- message.push(
- `* The jquery-integration optional feature should be explicitly set to a value under Octane, run \`ember feature:disable jquery-integration\` to disable it, or \`ember feature:enable jquery-integration\` to explicitly enable it`
- );
- }
-
if (
optionalFeaturesMissing ||
optionalFeatures.isFeatureEnabled('application-template-wrapper')
@@ -122,14 +113,28 @@ module.exports = {
`You have configured your application to indicate that it is using the 'octane' edition (via \`setEdition('octane')\`), but the appropriate Octane features were not enabled:\n`
);
- const SilentError = require('silent-error');
throw new SilentError(message.join('\n\t'));
}
+ } else {
+ throw new SilentError(
+ 'The Ember Classic edition has been removed. Specifying "classic" in your package.json, or not specifying a value at all, is no longer supported. You must explicitly set the "ember.edition" property to "octane". You can also run `npx @ember/octanify` to do this. \n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_editions-classic'
+ );
+ }
+
+ if (
+ !optionalFeaturesMissing &&
+ optionalFeatures.isFeatureEnabled('jquery-integration') &&
+ typeof optionalFeatures.isFeatureExplicitlySet === 'function' &&
+ optionalFeatures.isFeatureExplicitlySet('jquery-integration')
+ ) {
+ throw new SilentError(
+ 'Setting the `jquery-integration` optional feature flag to `true` was deprecated in Ember 3.x and removed in Ember 4.0.0. You must add the `@ember/optional-features` addon and set this feature to `false`.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-jquery-integration'
+ );
}
},
transpileTree(tree, isProduction, shouldCompileModules) {
- let emberCliBabel = this.addons.find(a => a.name === 'ember-cli-babel');
+ let emberCliBabel = this.addons.find((a) => a.name === 'ember-cli-babel');
let parentOptions = this.parent && this.parent.options;
let appOptions = this.app && this.app.options;
@@ -138,6 +143,7 @@ module.exports = {
// We want to enable async/generator helpers if we are developing locally,
// but not for any other project.
let isEmberSource = this.project.name() === 'ember-source';
+ let babelHelperPlugin = injectBabelHelpers(isEmberSource);
let options = {
'ember-cli-babel': {
@@ -147,13 +153,13 @@ module.exports = {
babel: Object.assign({}, babelOptions, {
loose: true,
plugins: [
- injectBabelHelpers(isEmberSource),
+ babelHelperPlugin,
buildDebugMacroPlugin(!isProduction),
+ ...vmBabelPlugins({ isDebug: !isProduction }),
[
require.resolve('@babel/plugin-transform-block-scoping'),
{ throwIfClosureRequired: true },
],
- [require.resolve('@babel/plugin-transform-object-assign')],
],
}),
};
@@ -173,6 +179,10 @@ module.exports = {
},
buildEmberBundles(tree, isProduction) {
+ if (this._overrideTree) {
+ tree = new MergeTrees([tree, this._overrideTree], { overwrite: true });
+ }
+
let packages = this.transpileTree(new Funnel(tree, { srcDir: 'packages' }), isProduction);
let dependencies = this.transpileTree(
@@ -205,38 +215,17 @@ module.exports = {
return new MergeTrees([
concatBundle(emberFiles, {
outputFile: 'ember.js',
- footer: "require('ember');",
+ footer: `require('@ember/-internals/bootstrap')`,
}),
concatBundle(emberTestingFiles, {
outputFile: 'ember-testing.js',
- footer: `
- var testing = require('ember-testing');
- Ember.Test = testing.Test;
- Ember.Test.Adapter = testing.Adapter;
- Ember.Test.QUnitAdapter = testing.QUnitAdapter;
- Ember.setupForTesting = testing.setupForTesting;
- `,
+ footer: "require('ember-testing');",
}),
]);
},
treeForVendor(tree) {
- let jqueryPath;
-
- try {
- jqueryPath = path.dirname(
- resolve.sync('jquery/package.json', { basedir: this.project.root })
- );
- } catch (error) {
- jqueryPath = path.dirname(require.resolve('jquery/package.json'));
- }
-
- let jquery = new Funnel(jqueryPath + '/dist', {
- destDir: 'ember/jquery',
- files: ['jquery.js'],
- });
-
let templateCompiler = new Funnel(tree, {
destDir: 'ember',
include: ['ember-template-compiler.js', 'ember-template-compiler.map'],
@@ -244,13 +233,19 @@ module.exports = {
let ember;
let targets = (this.project && this.project.targets && this.project.targets.browsers) || [];
+ let targetNode = (this.project && this.project.targets && this.project.targets.node) || false;
const isProduction = process.env.EMBER_ENV === 'production';
if (
!isProduction &&
- (PRE_BUILT_TARGETS.every(target => targets.includes(target)) &&
- targets.length === PRE_BUILT_TARGETS.length)
+ // do the running applications targets match our prebuilt assets targets?
+ PRE_BUILT_TARGETS.every((target) => targets.includes(target)) &&
+ targets.length === PRE_BUILT_TARGETS.length &&
+ // if node is defined in targets we can't reliably use the prebuilt bundles
+ !targetNode &&
+ // if we have a custom override (e.g. for globals deprecations) we can't use the prebuilt bundles
+ !this._overrideTree
) {
ember = new Funnel(tree, {
destDir: 'ember',
@@ -265,6 +260,6 @@ module.exports = {
});
}
- return debugTree(new MergeTrees([ember, templateCompiler, jquery]), 'vendor:final');
+ return debugTree(new MergeTrees([ember, templateCompiler]), 'vendor:final');
},
};
diff --git a/lib/overrides.js b/lib/overrides.js
new file mode 100644
index 00000000000..79480649d1d
--- /dev/null
+++ b/lib/overrides.js
@@ -0,0 +1,350 @@
+const createFile = require('broccoli-file-creator');
+const semver = require('semver');
+const validSemverRange = require('semver/ranges/valid');
+
+const DEFAULT_OPTIONS = Object.freeze({
+ showAllEmberGlobalDeprecations: false,
+});
+
+function* walkAddonTree(project, pathToAddon = []) {
+ for (let addon of project.addons) {
+ yield [addon, pathToAddon];
+ yield* walkAddonTree(addon, [...pathToAddon, `${addon.name}@${addon.pkg.version}`]);
+ }
+}
+
+function requirementFor(pkg, deps = {}) {
+ return deps[pkg];
+}
+
+const KNOWN_DORMANT_ADDONS = Object.freeze([
+ 'ember-angle-bracket-invocation-polyfill',
+ 'ember-fn-helper-polyfill',
+ 'ember-in-element-polyfill',
+ 'ember-named-blocks-polyfill',
+ 'ember-on-modifier',
+]);
+module.exports = class Overrides {
+ static for(project, env = process.env) {
+ if (env.EMBER_ENV === 'production') {
+ return new Overrides([]);
+ } else {
+ return new Overrides(Overrides.addonsInfoFor(project), {
+ showAllEmberGlobalDeprecations: env.EMBER_GLOBAL_DEPRECATIONS === 'all',
+ });
+ }
+ }
+
+ static *addonsInfoFor(project) {
+ for (let [addon, pathToAddon] of walkAddonTree(project)) {
+ let version = addon.pkg.version;
+
+ if (addon.name === 'ember-cli-babel' && semver.lt(version, '7.26.6')) {
+ if (addon.parent === project) {
+ let requirement =
+ requirementFor('ember-cli-babel', project.pkg.dependencies) ||
+ requirementFor('ember-cli-babel', project.pkg.devDependencies);
+
+ let validRange = validSemverRange(requirement);
+ let compatible = validRange ? semver.satisfies('7.26.6', requirement) : true;
+
+ yield {
+ parent: `${project.name()} (your app)`,
+ topLevel: null,
+ version,
+ requirement,
+ compatible,
+ dormant: false,
+ path: [],
+ };
+ } else {
+ let requirement = requirementFor('ember-cli-babel', addon.parent.pkg.dependencies);
+ let validRange = validSemverRange(requirement);
+ let compatible = validRange ? semver.satisfies('7.26.6', requirement) : true;
+ let dormant =
+ KNOWN_DORMANT_ADDONS.includes(addon.parent.name) ||
+ (addon.parent._fileSystemInfo
+ ? addon.parent._fileSystemInfo().hasJSFiles === false
+ : false);
+
+ let topLevelAddon = addon.parent;
+
+ while (topLevelAddon.parent !== project) {
+ topLevelAddon = topLevelAddon.parent;
+ }
+
+ yield {
+ parent: `${addon.parent.name}@${addon.parent.pkg.version}`,
+ topLevel: topLevelAddon.name,
+ version,
+ requirement,
+ compatible,
+ dormant,
+ path: pathToAddon,
+ };
+ }
+ }
+ }
+ }
+
+ static printList(list, indent = '') {
+ let output = '';
+
+ for (let item of list) {
+ if (Array.isArray(item)) {
+ output += `${indent}* ${item[0]}\n`;
+ output += Overrides.printList(item[1], indent + ' ');
+ } else {
+ output += `${indent}* ${item}\n`;
+ }
+ }
+
+ return output;
+ }
+
+ constructor(addonsInfo, options = {}) {
+ let _addonsInfo = [];
+ let projectInfo;
+ let groupedByTopLevel = Object.create(null);
+ let groupedByVersion = Object.create(null);
+
+ for (let info of addonsInfo) {
+ _addonsInfo.push(info);
+
+ if (info.topLevel === null) {
+ projectInfo = info;
+ } else {
+ let topLevel = info.topLevel;
+ let addons = groupedByTopLevel[topLevel] || [];
+ groupedByTopLevel[topLevel] = [...addons, info];
+ }
+
+ let version = info.version;
+
+ let group = groupedByVersion[version] || Object.create(null);
+ groupedByVersion[version] = group;
+
+ let addons = group[info.parent] || [];
+ group[info.parent] = [...addons, info];
+ }
+
+ let dormantTopLevelAddons = [];
+ let compatibleTopLevelAddons = [];
+ let incompatibleTopLevelAddons = [];
+
+ let suggestions = [];
+ let hasActionableSuggestions = false;
+
+ if (_addonsInfo.length > 0) {
+ for (let addon of Object.keys(groupedByTopLevel)) {
+ let group = groupedByTopLevel[addon];
+
+ if (group.every((info) => info.dormant)) {
+ dormantTopLevelAddons.push(addon);
+ } else if (group.every((info) => info.compatible)) {
+ compatibleTopLevelAddons.push(addon);
+ } else {
+ incompatibleTopLevelAddons.push(addon);
+ }
+ }
+
+ if (projectInfo) {
+ suggestions.push('Upgrade your `devDependencies` on `ember-cli-babel` to `^7.26.6`.');
+ hasActionableSuggestions = true;
+ } else if (compatibleTopLevelAddons.length > 0) {
+ // Only show the compatible addons if the project itself is up-to-date, because updating the
+ // project's own dependency on ember-cli-babel to latest may also get these addons to use it
+ // as well. Otherwise, there is an unnecessary copy in the tree and it needs to be deduped.
+ suggestions.push(
+ 'If using yarn, run `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.'
+ );
+
+ suggestions.push('If using npm, run `npm dedupe`.');
+
+ hasActionableSuggestions = true;
+ }
+
+ if (incompatibleTopLevelAddons.length > 0) {
+ suggestions.push([
+ 'Upgrade the following addons to the latest version:',
+ incompatibleTopLevelAddons,
+ ]);
+
+ hasActionableSuggestions = true;
+ }
+
+ if (!hasActionableSuggestions) {
+ suggestions.push([
+ 'Upgrade the following addons to the latest version, if available:',
+ dormantTopLevelAddons,
+ ]);
+ }
+ }
+
+ this.addonsInfo = _addonsInfo;
+ this.projectInfo = projectInfo;
+ this.groupedByTopLevel = groupedByTopLevel;
+ this.groupedByVersion = groupedByVersion;
+ this.dormantTopLevelAddons = dormantTopLevelAddons;
+ this.compatibleTopLevelAddons = compatibleTopLevelAddons;
+ this.incompatibleTopLevelAddons = incompatibleTopLevelAddons;
+ this.suggestions = suggestions;
+ this.hasActionableSuggestions = hasActionableSuggestions;
+ this.options = { ...DEFAULT_OPTIONS, ...options };
+ }
+
+ get hasOverrides() {
+ return this.addonsInfo.length > 0;
+ }
+
+ get hasBuildTimeWarning() {
+ return this.hasActionableSuggestions;
+ }
+
+ get hasCompatibleAddons() {
+ return this.addonsInfo.some((info) => info.compatible);
+ }
+
+ get hasDormantAddons() {
+ return this.addonsInfo.some((info) => info.dormant);
+ }
+
+ get showAllEmberGlobalDeprecations() {
+ return !this.hasActionableSuggestions || this.options.showAllEmberGlobalDeprecations;
+ }
+
+ get details() {
+ let details =
+ '\n### Details ###\n\n' +
+ 'Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, ' +
+ 'potentially triggering this deprecation message indirectly, ' +
+ 'even when you did not observe these deprecated usages in your code.\n\n' +
+ 'The following outdated versions are found in your project:\n\n' +
+ Overrides.printList(this.outdated);
+
+ if (this.hasDormantAddons) {
+ details +=
+ '\nNote: Addons marked as "Dormant" does not appear to have any JavaScript files. ' +
+ 'Therefore, even if they are using an old version ember-cli-babel, they are ' +
+ 'unlikely to be the culprit of this deprecation and can likely be ignored.\n';
+ }
+
+ if (this.hasCompatibleAddons) {
+ details += `\nNote: Addons marked as "Compatible" are already compatible with ember-cli-babel@7.26.6. `;
+
+ if (this.projectInfo) {
+ details += 'Try upgrading your `devDependencies` on `ember-cli-babel` to `^7.26.6`.\n';
+ } else {
+ details +=
+ 'If using yarn, try running `npx yarn-deduplicate --packages ember-cli-babel` followed by `yarn install`.' +
+ 'If using npm, try running `npm dedupe`.\n';
+ }
+ }
+
+ return details;
+ }
+
+ get outdated() {
+ let list = [];
+
+ let groupedByVersion = this.groupedByVersion;
+
+ for (let version of Object.keys(groupedByVersion).sort(semver.compare)) {
+ let addons = [];
+
+ for (let parent of Object.keys(groupedByVersion[version]).sort()) {
+ let info = groupedByVersion[version][parent][0];
+ let addon;
+ let details = [];
+
+ if (info.dormant) {
+ addon = `${parent} (Dormant)`;
+ } else if (info.compatible) {
+ addon = `${parent} (Compatible)`;
+ } else {
+ addon = parent;
+ }
+
+ details.push(`Depends on ember-cli-babel@${info.requirement}`);
+
+ for (let info of groupedByVersion[version][parent]) {
+ let addedBy = info.path.slice(0, -1);
+
+ if (addedBy.length) {
+ details.push(`Added by ${addedBy.join(' > ')}`);
+ }
+ }
+
+ addons.push([addon, details]);
+ }
+
+ list.push([`ember-cli-babel@${version}, currently used by:`, addons]);
+ }
+
+ return list;
+ }
+
+ get globalMessage() {
+ let message =
+ 'Usage of the Ember Global is deprecated. ' +
+ 'You should import the Ember module or the specific API instead.\n\n' +
+ 'See https://deprecations.emberjs.com/v3.x/#toc_ember-global for details.\n\n' +
+ 'Usages of the Ember Global may be caused by an outdated ember-cli-babel dependency. ' +
+ 'The following steps may help:\n\n' +
+ Overrides.printList(this.suggestions);
+
+ if (!this.showAllEmberGlobalDeprecations) {
+ message +=
+ '\n### Important ###\n\n' +
+ 'In order to avoid repeatedly showing the same deprecation messages, ' +
+ 'no further deprecation messages will be shown for usages of the Ember Global ' +
+ 'until ember-cli-babel is upgraded to v7.26.6 or above.\n\n' +
+ 'To see all instances of this deprecation message, ' +
+ 'set the `EMBER_GLOBAL_DEPRECATIONS` environment variable to "all", ' +
+ 'e.g. `EMBER_GLOBAL_DEPRECATIONS=all ember test`.\n';
+ }
+
+ message += this.details;
+
+ return message;
+ }
+
+ get buildTimeWarning() {
+ if (this.hasBuildTimeWarning) {
+ return `[DEPRECATION] ${this.globalMessage}`;
+ } else {
+ return '';
+ }
+ }
+
+ toTree() {
+ if (this.hasOverrides) {
+ return createFile('packages/@ember/-internals/overrides/index.js', this.toModule());
+ }
+ }
+
+ toModule() {
+ return `
+ ${this.toJS()};
+ `;
+ }
+
+ toJS() {
+ return `
+ function once(callback) {
+ let called = false;
+
+ return (...args) => {
+ if (called) {
+ return null;
+ } else {
+ called = true;
+ return callback(...args);
+ }
+ };
+ }
+
+ ${this.onDotAcces}
+ `;
+ }
+};
diff --git a/lib/transforms/inject-babel-helpers.js b/lib/transforms/inject-babel-helpers.js
index 18cc33ed212..b89e1ab5df4 100644
--- a/lib/transforms/inject-babel-helpers.js
+++ b/lib/transforms/inject-babel-helpers.js
@@ -3,29 +3,37 @@
const { addNamed } = require('@babel/helper-module-imports');
function injectBabelHelpers(isEmberSource = false) {
- function injectBabelHelpersPlugin() {
- return {
- pre(file) {
- file.set('helperGenerator', function(name) {
- if (name === 'extends') {
- return addNamed(file.path, 'assign', '@ember/polyfills');
- } else if (isEmberSource && name === 'asyncToGenerator') {
- // Returning a falsy value will cause the helper to be inlined,
- // which is fine for local tests
- return false;
- }
-
- return addNamed(file.path, name, 'ember-babel');
- });
- },
- };
- }
+ let helperplugin = injectBabelHelpersPlugin;
+ helperplugin._parallelBabel = {
+ requireFile: __filename,
+ buildUsing: 'injectBabelHelpersPlugin',
+ params: { isEmberSource },
+ };
- injectBabelHelpersPlugin.baseDir = function() {
+ helperplugin.baseDir = function () {
return 'babel-core';
};
- return injectBabelHelpersPlugin;
+ return helperplugin;
+}
+
+function injectBabelHelpersPlugin(isEmberSource) {
+ return {
+ pre(file) {
+ file.set('helperGenerator', function (name) {
+ if (isEmberSource && name === 'asyncToGenerator') {
+ // Returning a falsy value will cause the helper to be inlined,
+ // which is fine for local tests
+ return false;
+ }
+
+ return addNamed(file.path, name, 'ember-babel');
+ });
+ },
+ };
}
-module.exports = injectBabelHelpers;
+module.exports = {
+ injectBabelHelpers,
+ injectBabelHelpersPlugin,
+};
diff --git a/node-tests/blueprints/acceptance-test-test.js b/node-tests/blueprints/acceptance-test-test.js
index 763464b3647..2ef48c1948f 100644
--- a/node-tests/blueprints/acceptance-test-test.js
+++ b/node-tests/blueprints/acceptance-test-test.js
@@ -10,20 +10,18 @@ const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const fixture = require('../helpers/fixture');
-describe('Blueprint: acceptance-test', function() {
+describe('Blueprint: acceptance-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -31,8 +29,8 @@ describe('Blueprint: acceptance-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/default.js')
);
@@ -40,8 +38,8 @@ describe('Blueprint: acceptance-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -49,8 +47,8 @@ describe('Blueprint: acceptance-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/qunit-rfc268.js')
);
@@ -58,16 +56,16 @@ describe('Blueprint: acceptance-test', function() {
});
});
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
]);
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/mocha.js')
);
@@ -75,14 +73,17 @@ describe('Blueprint: acceptance-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/mocha-rfc268.js')
);
@@ -91,13 +92,13 @@ describe('Blueprint: acceptance-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -105,8 +106,8 @@ describe('Blueprint: acceptance-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/addon-default.js')
);
@@ -115,8 +116,8 @@ describe('Blueprint: acceptance-test', function() {
});
});
- it('acceptance-test foo/bar', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo/bar'], _file => {
+ it('acceptance-test foo/bar', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo/bar'], (_file) => {
expect(_file('tests/acceptance/foo/bar-test.js')).to.equal(
fixture('acceptance-test/addon-nested.js')
);
@@ -126,52 +127,8 @@ describe('Blueprint: acceptance-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
- expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/qunit-rfc268.js')
- );
- });
- });
- });
- });
-
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
- expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/default.js')
- );
- });
- });
- });
-
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -179,98 +136,28 @@ describe('Blueprint: acceptance-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
- expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/qunit-rfc268.js')
- );
- });
- });
- });
-
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- });
-
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
- expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/mocha.js')
- );
- });
- });
- });
-
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
- expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/mocha-rfc268.js')
- );
- });
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/addon-default.js')
+ fixture('acceptance-test/qunit-rfc268-addon.js')
);
-
- expect(_file('app/acceptance-tests/foo.js')).to.not.exist;
- });
- });
-
- it('acceptance-test foo/bar', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo/bar'], _file => {
- expect(_file('tests/acceptance/foo/bar-test.js')).to.equal(
- fixture('acceptance-test/addon-nested.js')
- );
-
- expect(_file('app/acceptance-tests/foo/bar.js')).to.not.exist;
});
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
+ { name: 'ember-mocha', dev: true },
]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
+ generateFakePackageManifest('ember-mocha', '0.16.2');
});
- it('acceptance-test foo', function() {
- return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
+ it('acceptance-test foo', function () {
+ return emberGenerateDestroy(['acceptance-test', 'foo'], (_file) => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
- fixture('acceptance-test/qunit-rfc268.js')
+ fixture('acceptance-test/mocha-rfc268-addon.js')
);
});
});
diff --git a/node-tests/blueprints/component-addon-test.js b/node-tests/blueprints/component-addon-test.js
index 0cfe86356db..b2f898f330f 100644
--- a/node-tests/blueprints/component-addon-test.js
+++ b/node-tests/blueprints/component-addon-test.js
@@ -8,23 +8,23 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-describe('Blueprint: component-addon', function() {
+describe('Blueprint: component-addon', function () {
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('component-addon foo', function() {
- return emberGenerateDestroy(['component-addon', 'foo'], _file => {
+ it('component-addon foo', function () {
+ return emberGenerateDestroy(['component-addon', 'foo'], (_file) => {
expect(_file('app/components/foo.js')).to.contain(
"export { default } from 'my-addon/components/foo';"
);
});
});
- it('component-addon foo-bar', function() {
- return emberGenerateDestroy(['component-addon', 'foo-bar'], _file => {
+ it('component-addon foo-bar', function () {
+ return emberGenerateDestroy(['component-addon', 'foo-bar'], (_file) => {
expect(_file('app/components/foo-bar.js')).to.contain(
"export { default } from 'my-addon/components/foo-bar';"
);
diff --git a/node-tests/blueprints/component-class-addon-test.js b/node-tests/blueprints/component-class-addon-test.js
index a5acecacb79..19a42c309f3 100644
--- a/node-tests/blueprints/component-class-addon-test.js
+++ b/node-tests/blueprints/component-class-addon-test.js
@@ -4,27 +4,29 @@ const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
-
+const setupTestEnvironment = require('../helpers/setup-test-environment');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-describe('Blueprint: component-class-addon', function() {
+const enableOctane = setupTestEnvironment.enableOctane;
+describe('Blueprint: component-class-addon', function () {
+ enableOctane();
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('component-addon foo', function() {
- return emberGenerateDestroy(['component-class-addon', 'foo'], _file => {
+ it('component-addon foo', function () {
+ return emberGenerateDestroy(['component-class-addon', 'foo'], (_file) => {
expect(_file('app/components/foo.js')).to.contain(
"export { default } from 'my-addon/components/foo';"
);
});
});
- it('component-addon foo-bar', function() {
- return emberGenerateDestroy(['component-class-addon', 'foo-bar'], _file => {
+ it('component-addon foo-bar', function () {
+ return emberGenerateDestroy(['component-class-addon', 'foo-bar'], (_file) => {
expect(_file('app/components/foo-bar.js')).to.contain(
"export { default } from 'my-addon/components/foo-bar';"
);
diff --git a/node-tests/blueprints/component-class-test.js b/node-tests/blueprints/component-class-test.js
index f7d358d4d1a..4eb913c76ee 100644
--- a/node-tests/blueprints/component-class-test.js
+++ b/node-tests/blueprints/component-class-test.js
@@ -16,18 +16,14 @@ const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
const enableOctane = setupTestEnvironment.enableOctane;
-const { EMBER_SET_COMPONENT_TEMPLATE } = require('../../blueprints/component');
-
const glimmerComponentContents = `import Component from '@glimmer/component';
-export default class FooComponent extends Component {
-}
+export default class FooComponent extends Component {}
`;
const emberComponentContents = `import Component from '@ember/component';
-export default Component.extend({
-});
+export default Component.extend({});
`;
const templateOnlyContents = `import templateOnly from '@ember/component/template-only';
@@ -35,11 +31,13 @@ const templateOnlyContents = `import templateOnly from '@ember/component/templat
export default templateOnly();
`;
-describe('Blueprint: component-class', function() {
+describe('Blueprint: component-class', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -50,242 +48,169 @@ describe('Blueprint: component-class', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component-class foo', function() {
- return emberGenerateDestroy(['component-class', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- });
- });
-
- if (EMBER_SET_COMPONENT_TEMPLATE) {
- // classic default
- it('component-class foo --component-structure=classic --component-class=@ember/component', function() {
- return emberGenerateDestroy(
- [
- 'component-class',
- 'foo',
- '--component-structure',
- 'classic',
- '--component-class',
- '@ember/component',
- ],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- }
- );
- });
-
- // Octane default
- it('component-class foo --component-structure=flat --component-class=@glimmer/component', function() {
- return emberGenerateDestroy(
- [
- 'component-class',
- '--component-structure',
- 'flat',
- '--component-class',
- '@glimmer/component',
- 'foo',
- ],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
- }
- );
- });
-
- it('component-class foo --component-structure=flat', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-structure', 'flat', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- }
- );
- });
-
- it('component-class foo --component-structure=nested', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-structure', 'nested', 'foo'],
- _file => {
- expect(_file('app/components/foo/index.js')).to.equal(emberComponentContents);
- }
- );
- });
-
- it('component-class foo --component-structure=classic', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-structure', 'classic', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- }
- );
- });
-
- it('component-class foo --component-class=@ember/component', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-class', '@ember/component', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- }
- );
- });
-
- it('component-class foo --component-class=@glimmer/component', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-class', '@glimmer/component', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
- }
- );
- });
-
- it('component-class foo --component-class=@ember/component/template-only', function() {
- return emberGenerateDestroy(
- ['component-class', '--component-class', '@ember/component/template-only', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(templateOnlyContents);
- }
- );
- });
- }
-
- it('component-class x-foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(fixture('component/component-dash.js'));
- });
- });
-
- it('component-class foo/x-foo', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo'], _file => {
- expect(_file('app/components/foo/x-foo.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ it('component-class foo', function () {
+ return emberGenerateDestroy(['component-class', 'foo'], (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
});
});
- it('component-class x-foo --path foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--path', 'foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(fixture('component/component-dash.js'));
- });
+ // classic default
+ it('component-class foo --component-structure=classic --component-class=@ember/component', function () {
+ return emberGenerateDestroy(
+ [
+ 'component-class',
+ 'foo',
+ '--component-structure',
+ 'classic',
+ '--component-class',
+ '@ember/component',
+ ],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
+ }
+ );
});
- it('component-class foo.js', function() {
- return emberGenerateDestroy(['component-class', 'foo.js'], _file => {
- expect(_file('app/components/foo.js.js')).to.not.exist;
- expect(_file('app/components/foo.js')).to.equal(fixture('component/component.js'));
- });
+ // Octane default
+ it('component-class foo --component-structure=flat --component-class=@glimmer/component', function () {
+ return emberGenerateDestroy(
+ [
+ 'component-class',
+ '--component-structure',
+ 'flat',
+ '--component-class',
+ '@glimmer/component',
+ 'foo',
+ ],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+ }
+ );
});
- it('component-class x-foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod'], _file => {
- expect(_file('app/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
- });
+ it('component-class foo --component-structure=flat', function () {
+ return emberGenerateDestroy(
+ ['component-class', '--component-structure', 'flat', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+ }
+ );
});
- it('component-class foo/x-foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo', '--pod'], _file => {
- expect(_file('app/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
- });
+ it('component-class foo --component-structure=nested', function () {
+ return emberGenerateDestroy(
+ ['component-class', '--component-structure', 'nested', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo/index.js')).to.equal(glimmerComponentContents);
+ }
+ );
});
- it('component-class x-foo --pod --path foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod', '--path', 'foo'], _file => {
- expect(_file('app/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
- });
+ it('component-class foo --component-structure=classic', function () {
+ return emberGenerateDestroy(
+ ['component-class', '--component-structure', 'classic', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+ }
+ );
});
- it('component-class foo/x-foo --pod --path bar', function() {
+ it('component-class foo --component-class=@ember/component', function () {
return emberGenerateDestroy(
- ['component-class', 'foo/x-foo', '--pod', '--path', 'bar'],
- _file => {
- expect(_file('app/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ ['component-class', '--component-class', '@ember/component', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
}
);
});
- it('component-class x-foo --pod --path bar/foo', function() {
+ it('component-class foo --component-class=@glimmer/component', function () {
return emberGenerateDestroy(
- ['component-class', 'x-foo', '--pod', '--path', 'bar/foo'],
- _file => {
- expect(_file('app/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
+ ['component-class', '--component-class', '@glimmer/component', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
}
);
});
- it('component-class foo/x-foo --pod --path bar/baz', function() {
+ it('component-class foo --component-class=@ember/component/template-only', function () {
return emberGenerateDestroy(
- ['component-class', 'foo/x-foo', '--pod', '--path', 'bar/baz'],
- _file => {
- expect(_file('app/bar/baz/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ ['component-class', '--component-class', '@ember/component/template-only', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(templateOnlyContents);
}
);
});
- it('component-class x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/x-foo/component.js')).to.equal(fixture('component/component-dash.js'));
+ it('component-class x-foo', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo'], (_file) => {
+ expect(_file('app/components/x-foo.js')).to.equal(
+ glimmerComponentContents.replace('FooComponent', 'XFooComponent')
+ );
});
});
- it('component-class foo/x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
+ it('component-class x-foo.js', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo.js'], (_file) => {
+ expect(_file('app/components/x-foo.js.js')).to.not.exist;
+ expect(_file('app/components/x-foo.js')).to.equal(
+ glimmerComponentContents.replace('FooComponent', 'XFooComponent')
);
});
});
- it('component-class x-foo.js --pod', function() {
- return emberGenerateDestroy(['component-class', 'x-foo.js', '--pod'], _file => {
- expect(_file('app/components/x-foo.js/component.js')).to.not.exist;
- expect(_file('app/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
+ it('component-class foo/x-foo', function () {
+ return emberGenerateDestroy(['component-class', 'foo/x-foo'], (_file) => {
+ expect(_file('app/components/foo/x-foo.js')).to.equal(
+ glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
);
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ it('component-class foo/x-foo --component-class="@glimmer/component"', function () {
+ return emberGenerateDestroy(
+ ['component-class', 'foo/x-foo', '--component-class', '@glimmer/component'],
+ (_file) => {
+ expect(_file('app/components/foo/x-foo.js')).to.equal(
+ glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
+ );
+ }
+ );
+ });
+
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('component-class foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'foo', '--pod'], _file => {
+ it('component-class foo --pod', function () {
+ return emberGenerateDestroy(['component-class', 'foo', '--pod'], (_file) => {
expect(_file('app/pods/components/foo/component.js')).to.equal(
fixture('component/component.js')
);
});
});
- it('component-class x-foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod'], _file => {
+ it('component-class x-foo --pod', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo', '--pod'], (_file) => {
expect(_file('app/pods/components/x-foo/component.js')).to.equal(
fixture('component/component-dash.js')
);
});
});
- it('component-class foo/x-foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo', '--pod'], _file => {
+ it('component-class foo/x-foo --pod', function () {
+ return emberGenerateDestroy(['component-class', 'foo/x-foo', '--pod'], (_file) => {
expect(_file('app/pods/components/foo/x-foo/component.js')).to.equal(
fixture('component/component-nested.js')
);
});
});
- it('component-class x-foo --pod --path foo', function() {
+ it('component-class x-foo --pod --path foo', function () {
return emberGenerateDestroy(
['component-class', 'x-foo', '--pod', '--path', 'foo'],
- _file => {
+ (_file) => {
expect(_file('app/pods/foo/x-foo/component.js')).to.equal(
fixture('component/component-dash.js')
);
@@ -293,10 +218,10 @@ describe('Blueprint: component-class', function() {
);
});
- it('component-class foo/x-foo --pod --path bar', function() {
+ it('component-class foo/x-foo --pod --path bar', function () {
return emberGenerateDestroy(
['component-class', 'foo/x-foo', '--pod', '--path', 'bar'],
- _file => {
+ (_file) => {
expect(_file('app/pods/bar/foo/x-foo/component.js')).to.equal(
fixture('component/component-nested.js')
);
@@ -304,10 +229,10 @@ describe('Blueprint: component-class', function() {
);
});
- it('component-class x-foo --pod --path bar/foo', function() {
+ it('component-class x-foo --pod --path bar/foo', function () {
return emberGenerateDestroy(
['component-class', 'x-foo', '--pod', '--path', 'bar/foo'],
- _file => {
+ (_file) => {
expect(_file('app/pods/bar/foo/x-foo/component.js')).to.equal(
fixture('component/component-dash.js')
);
@@ -315,10 +240,10 @@ describe('Blueprint: component-class', function() {
);
});
- it('component-class foo/x-foo --pod --path bar/baz', function() {
+ it('component-class foo/x-foo --pod --path bar/baz', function () {
return emberGenerateDestroy(
['component-class', 'foo/x-foo', '--pod', '--path', 'bar/baz'],
- _file => {
+ (_file) => {
expect(_file('app/pods/bar/baz/foo/x-foo/component.js')).to.equal(
fixture('component/component-nested.js')
);
@@ -326,18 +251,18 @@ describe('Blueprint: component-class', function() {
);
});
- it('component-class x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod', '-no-path'], _file => {
+ it('component-class x-foo --pod -no-path', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo', '--pod', '-no-path'], (_file) => {
expect(_file('app/pods/x-foo/component.js')).to.equal(
fixture('component/component-dash.js')
);
});
});
- it('component-class foo/x-foo --pod -no-path', function() {
+ it('component-class foo/x-foo --pod -no-path', function () {
return emberGenerateDestroy(
['component-class', 'foo/x-foo', '--pod', '-no-path'],
- _file => {
+ (_file) => {
expect(_file('app/pods/foo/x-foo/component.js')).to.equal(
fixture('component/component-nested.js')
);
@@ -347,65 +272,10 @@ describe('Blueprint: component-class', function() {
});
});
- describe('in app - octane', function() {
+ describe('in addon - octane', function () {
enableOctane();
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component-class foo', function() {
- return emberGenerateDestroy(['component-class', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
- });
- });
-
- it('component-class x-foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(
- glimmerComponentContents.replace('FooComponent', 'XFooComponent')
- );
- });
- });
-
- it('component-class x-foo.js', function() {
- return emberGenerateDestroy(['component-class', 'x-foo.js'], _file => {
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('app/components/x-foo.js')).to.equal(
- glimmerComponentContents.replace('FooComponent', 'XFooComponent')
- );
- });
- });
-
- it('component-class foo/x-foo', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo'], _file => {
- expect(_file('app/components/foo/x-foo.js')).to.equal(
- glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
- );
- });
- });
-
- it('component-class foo/x-foo --component-class="@glimmer/component"', function() {
- return emberGenerateDestroy(
- ['component-class', 'foo/x-foo', '--component-class', '@glimmer/component'],
- _file => {
- expect(_file('app/components/foo/x-foo.js')).to.equal(
- glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
- );
- }
- );
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -416,107 +286,8 @@ describe('Blueprint: component-class', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component-class foo', function() {
- return emberGenerateDestroy(['component-class', 'foo'], _file => {
- expect(_file('addon/components/foo.js')).to.equal(fixture('component/component-addon.js'));
- expect(_file('app/components/foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo';"
- );
- });
- });
-
- it('component-class x-foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo'], _file => {
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
- });
- });
-
- it('component-class x-foo.js', function() {
- return emberGenerateDestroy(['component-class', 'x-foo.js'], _file => {
- expect(_file('addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
- });
- });
-
- it('component-class foo/x-foo', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo'], _file => {
- expect(_file('addon/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
- expect(_file('app/components/foo/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo';"
- );
- });
- });
-
- it('component-class x-foo --dummy', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('app/components/x-foo.js')).to.not.exist;
- });
- });
-
- it('component-class foo/x-foo --dummy', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
- expect(_file('app/components/foo/x-foo.js')).to.not.exist;
- });
- });
-
- it('component-class x-foo.js --dummy', function() {
- return emberGenerateDestroy(['component-class', 'x-foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js.js')).to.not.exist;
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('app/components/x-foo.js')).to.not.exist;
- });
- });
-
- it('component-class x-foo --pod', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--pod'], _file => {
- expect(_file('addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
- expect(_file('app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
- });
- });
- });
-
- describe('in addon - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component-class foo', function() {
- return emberGenerateDestroy(['component-class', 'foo'], _file => {
+ it('component-class foo', function () {
+ return emberGenerateDestroy(['component-class', 'foo'], (_file) => {
expect(_file('addon/components/foo.js')).to.equal(glimmerComponentContents);
expect(_file('app/components/foo.js')).to.contain(
"export { default } from 'my-addon/components/foo';"
@@ -524,8 +295,8 @@ describe('Blueprint: component-class', function() {
});
});
- it('component-class x-foo', function() {
- return emberGenerateDestroy(['component-class', 'x-foo'], _file => {
+ it('component-class x-foo', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo'], (_file) => {
expect(_file('addon/components/x-foo.js')).to.equal(
glimmerComponentContents.replace('FooComponent', 'XFooComponent')
);
@@ -535,8 +306,8 @@ describe('Blueprint: component-class', function() {
});
});
- it('component-class foo/x-foo', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo'], _file => {
+ it('component-class foo/x-foo', function () {
+ return emberGenerateDestroy(['component-class', 'foo/x-foo'], (_file) => {
expect(_file('addon/components/foo/x-foo.js')).to.equal(
glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
);
@@ -546,8 +317,8 @@ describe('Blueprint: component-class', function() {
});
});
- it('component-class x-foo --dummy', function() {
- return emberGenerateDestroy(['component-class', 'x-foo', '--dummy'], _file => {
+ it('component-class x-foo --dummy', function () {
+ return emberGenerateDestroy(['component-class', 'x-foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/components/x-foo.js')).equal(
glimmerComponentContents.replace('FooComponent', 'XFooComponent')
);
@@ -555,8 +326,8 @@ describe('Blueprint: component-class', function() {
});
});
- it('component-class foo/x-foo --dummy', function() {
- return emberGenerateDestroy(['component-class', 'foo/x-foo', '--dummy'], _file => {
+ it('component-class foo/x-foo --dummy', function () {
+ return emberGenerateDestroy(['component-class', 'foo/x-foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.equal(
glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
);
@@ -565,8 +336,10 @@ describe('Blueprint: component-class', function() {
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -577,134 +350,22 @@ describe('Blueprint: component-class', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component-class foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component-class', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/foo.js')).to.equal(
- fixture('component/component-addon.js')
- );
- expect(_file('lib/my-addon/app/components/foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo';"
- );
- });
- });
-
- it('component-class x-foo --in-repo-addon=my-addon', function() {
+ it('component-class foo --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
- ['component-class', 'x-foo', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
+ ['component-class', 'foo', '--in-repo-addon=my-addon'],
+ (_file) => {
+ expect(_file('lib/my-addon/addon/components/foo.js')).to.equal(glimmerComponentContents);
+ expect(_file('lib/my-addon/app/components/foo.js')).to.contain(
+ "export { default } from 'my-addon/components/foo';"
);
}
);
});
- it('component-class x-foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(
- ['component-class', 'x-foo.js', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/app/components/x-foo.js.js')).to.not.exist;
-
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
- expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
- }
- );
- });
-
- it('component-class foo/x-foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(
- ['component-class', 'foo/x-foo', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('lib/my-addon/addon/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
- expect(_file('lib/my-addon/app/components/foo/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo';"
- );
- }
- );
- });
-
- it('component-class x-foo --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component-class', 'x-foo', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
- expect(_file('lib/my-addon/app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
- }
- );
- });
-
- it('component-class x-foo.js --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component-class', 'x-foo.js', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo/component.js.js')).to.not.exist;
- expect(_file('lib/my-addon/app/components/x-foo/component.js.js')).to.not.exist;
- expect(_file('lib/my-addon/addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
- expect(_file('lib/my-addon/app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
- }
- );
- });
-
- it('component-class foo/x-foo --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component-class', 'foo/x-foo', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-addon-nested-pod.js')
- );
- expect(_file('lib/my-addon/app/components/foo/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo/component';"
- );
- }
- );
- });
- });
-
- describe('in in-repo-addon - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew({ target: 'in-repo-addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component-class foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component-class', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/foo.js')).to.equal(glimmerComponentContents);
- expect(_file('lib/my-addon/app/components/foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo';"
- );
- });
- });
-
- it('component-class x-foo --in-repo-addon=my-addon', function() {
+ it('component-class x-foo --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
['component-class', 'x-foo', '--in-repo-addon=my-addon'],
- _file => {
+ (_file) => {
expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
glimmerComponentContents.replace('FooComponent', 'XFooComponent')
);
diff --git a/node-tests/blueprints/component-test-test.js b/node-tests/blueprints/component-test-test.js
index bdaaa7a579f..ea29b87d637 100644
--- a/node-tests/blueprints/component-test-test.js
+++ b/node-tests/blueprints/component-test-test.js
@@ -14,25 +14,25 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-describe('Blueprint: component-test', function() {
+describe('Blueprint: component-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with default setup', function() {
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ describe('with default setup', function () {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/rfc232.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/rfc232-unit.js')
);
@@ -40,8 +40,8 @@ describe('Blueprint: component-test', function() {
});
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -49,24 +49,24 @@ describe('Blueprint: component-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/unit.js')
);
});
});
- describe('with usePods=true', function() {
- beforeEach(function() {
+ describe('with usePods=true', function () {
+ beforeEach(function () {
fs.writeFileSync(
'.ember-cli',
`{
@@ -76,8 +76,8 @@ describe('Blueprint: component-test', function() {
);
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
fixture('component-test/default.js')
);
@@ -86,8 +86,8 @@ describe('Blueprint: component-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -95,16 +95,16 @@ describe('Blueprint: component-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/rfc232.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/rfc232-unit.js')
);
@@ -112,8 +112,8 @@ describe('Blueprint: component-test', function() {
});
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.11.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -121,16 +121,16 @@ describe('Blueprint: component-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.11.0');
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha-unit.js')
);
@@ -138,8 +138,8 @@ describe('Blueprint: component-test', function() {
});
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.12.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -147,16 +147,16 @@ describe('Blueprint: component-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.12.0');
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha-0.12.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha-0.12-unit.js')
);
@@ -164,22 +164,25 @@ describe('Blueprint: component-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha-rfc232.js')
);
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/mocha-rfc232-unit.js')
);
@@ -188,51 +191,98 @@ describe('Blueprint: component-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
+ describe('in addon', function () {
+ beforeEach(function () {
+ return emberNew({ target: 'addon' });
});
- it('component-test x-foo', function() {
- return emberGenerateDestroy(['component-test', 'x-foo'], _file => {
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default.js')
- );
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-cli-qunit', dev: true },
+ ]);
+ generateFakePackageManifest('ember-cli-qunit', '4.1.0');
+ });
+
+ it('component-test x-foo', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo'], (_file) => {
+ expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
+ fixture('component-test/default.js')
+ );
+
+ expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ });
+ });
+
+ it('component-test x-foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], (_file) => {
+ expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
+ fixture('component-test/unit.js')
+ );
+
+ expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ });
+ });
- expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ it('component-test x-foo --dummy', function () {
+ return emberGenerateDestroy(['component-test', 'x-foo', '--dummy'], (_file) => {
+ expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
+ fixture('component-test/default.js')
+ );
+
+ expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ });
});
});
- it('component-test x-foo --unit', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--unit'], _file => {
- expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
- fixture('component-test/unit.js')
- );
+ describe('with ember-qunit (default)', function () {
+ it('component-test foo', function () {
+ return emberGenerateDestroy(['component-test', 'foo'], (_file) => {
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/rfc232-addon.js')
+ );
+ });
+ });
- expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ it('component-test foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'foo', '--unit'], (_file) => {
+ expect(_file('tests/unit/components/foo-test.js')).to.equal(
+ fixture('component-test/rfc232-unit-addon.js')
+ );
+ });
});
});
- it('component-test x-foo --dummy', function() {
- return emberGenerateDestroy(['component-test', 'x-foo', '--dummy'], _file => {
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default.js')
- );
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
+ generateFakePackageManifest('ember-mocha', '0.16.2');
+ });
+
+ it('component-test foo', function () {
+ return emberGenerateDestroy(['component-test', 'foo'], (_file) => {
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
+ fixture('component-test/mocha-rfc232-addon.js')
+ );
+ });
+ });
- expect(_file('app/component-test/x-foo.js')).to.not.exist;
+ it('component-test foo --unit', function () {
+ return emberGenerateDestroy(['component-test', 'foo', '--unit'], (_file) => {
+ expect(_file('tests/unit/components/foo-test.js')).to.equal(
+ fixture('component-test/mocha-rfc232-unit-addon.js')
+ );
+ });
});
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -243,10 +293,10 @@ describe('Blueprint: component-test', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component-test x-foo --in-repo-addon=my-addon', function() {
+ it('component-test x-foo --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
['component-test', 'x-foo', '--in-repo-addon=my-addon'],
- _file => {
+ (_file) => {
expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
fixture('component-test/default.js')
);
@@ -254,10 +304,10 @@ describe('Blueprint: component-test', function() {
);
});
- it('component-test x-foo --in-repo-addon=my-addon --unit', function() {
+ it('component-test x-foo --in-repo-addon=my-addon --unit', function () {
return emberGenerateDestroy(
['component-test', 'x-foo', '--in-repo-addon=my-addon', '--unit'],
- _file => {
+ (_file) => {
expect(_file('tests/unit/components/x-foo-test.js')).to.equal(
fixture('component-test/unit.js')
);
diff --git a/node-tests/blueprints/component-test.js b/node-tests/blueprints/component-test.js
index 37c0021ad1c..3769e94f1bd 100644
--- a/node-tests/blueprints/component-test.js
+++ b/node-tests/blueprints/component-test.js
@@ -16,18 +16,14 @@ const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
const enableOctane = setupTestEnvironment.enableOctane;
-const { EMBER_SET_COMPONENT_TEMPLATE } = require('../../blueprints/component');
-
const glimmerComponentContents = `import Component from '@glimmer/component';
-export default class FooComponent extends Component {
-}
+export default class FooComponent extends Component {}
`;
const emberComponentContents = `import Component from '@ember/component';
-export default Component.extend({
-});
+export default Component.extend({});
`;
const templateOnlyContents = `import templateOnly from '@ember/component/template-only';
@@ -35,11 +31,13 @@ const templateOnlyContents = `import templateOnly from '@ember/component/templat
export default templateOnly();
`;
-describe('Blueprint: component', function() {
+describe('Blueprint: component', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -50,11 +48,10 @@ describe('Blueprint: component', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
+ it('component foo', function () {
+ return emberGenerateDestroy(['component', 'foo'], (_file) => {
+ expect(_file('app/components/foo.js')).to.not.exist;
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
@@ -67,186 +64,19 @@ describe('Blueprint: component', function() {
});
});
- if (EMBER_SET_COMPONENT_TEMPLATE) {
- // classic default
- it('component foo --component-structure=classic --component-class=@ember/component', function() {
- return emberGenerateDestroy(
- [
- 'component',
- 'foo',
- '--component-structure',
- 'classic',
- '--component-class',
- '@ember/component',
- ],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- // Octane default
- it('component foo --component-structure=flat --component-class=@glimmer/component', function() {
- return emberGenerateDestroy(
- [
- 'component',
- '--component-structure',
- 'flat',
- '--component-class',
- '@glimmer/component',
- 'foo',
- ],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
-
- expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-structure=flat', function() {
- return emberGenerateDestroy(
- ['component', '--component-structure', 'flat', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
-
- expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-structure=nested', function() {
- return emberGenerateDestroy(
- ['component', '--component-structure', 'nested', 'foo'],
- _file => {
- expect(_file('app/components/foo/index.js')).to.equal(emberComponentContents);
-
- expect(_file('app/components/foo/index.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-structure=classic', function() {
- return emberGenerateDestroy(
- ['component', '--component-structure', 'classic', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-class=@ember/component', function() {
- return emberGenerateDestroy(
- ['component', '--component-class', '@ember/component', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-class=@glimmer/component', function() {
- return emberGenerateDestroy(
- ['component', '--component-class', '@glimmer/component', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --component-class=@ember/component/template-only', function() {
- return emberGenerateDestroy(
- ['component', '--component-class', '@ember/component/template-only', 'foo'],
- _file => {
- expect(_file('app/components/foo.js')).to.equal(templateOnlyContents);
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- }
- );
- });
-
- it('component foo --no-component-class', function() {
- return emberGenerateDestroy(['component', '--no-component-class', 'foo'], _file => {
- expect(_file('app/components/foo.js')).to.not.exist;
+ // classic default
+ it('component foo --component-structure=classic --component-class=@ember/component', function () {
+ return emberGenerateDestroy(
+ [
+ 'component',
+ 'foo',
+ '--component-structure',
+ 'classic',
+ '--component-class',
+ '@ember/component',
+ ],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
@@ -258,197 +88,31 @@ describe('Blueprint: component', function() {
},
})
);
- });
- });
- }
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(fixture('component/component-dash.js'));
-
- expect(_file('app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('app/components/foo/x-foo.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo --path foo', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--path', 'foo'], _file => {
- expect(_file('app/components/x-foo.js')).to.equal(fixture('component/component-dash.js'));
-
- expect(_file('app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo.js', function() {
- return emberGenerateDestroy(['component', 'foo.js'], _file => {
- expect(_file('app/components/foo.js.js')).to.not.exist;
- expect(_file('app/templates/components/foo.js.hbs')).to.not.exist;
- expect(_file('tests/integration/components/foo.js-test.js')).to.not.exist;
-
- expect(_file('app/components/foo.js')).to.equal(fixture('component/component.js'));
-
- expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- });
- });
-
- it('component x-foo --pod', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod'], _file => {
- expect(_file('app/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('app/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo --pod', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod'], _file => {
- expect(_file('app/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo --pod --path foo', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '--path', 'foo'], _file => {
- expect(_file('app/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('app/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'foo/',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo --pod --path bar', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod', '--path', 'bar'], _file => {
- expect(_file('app/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/bar/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- path: 'bar/',
- },
- })
- );
- });
- });
-
- it('component x-foo --pod --path bar/foo', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '--path', 'bar/foo'], _file => {
- expect(_file('app/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('app/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/bar/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'bar/foo/',
- },
- })
- );
- });
+ }
+ );
});
- it('component foo/x-foo --pod --path bar/baz', function() {
+ // Octane default
+ it('component foo --component-structure=flat --component-class=@glimmer/component', function () {
return emberGenerateDestroy(
- ['component', 'foo/x-foo', '--pod', '--path', 'bar/baz'],
- _file => {
- expect(_file('app/bar/baz/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ [
+ 'component',
+ '--component-structure',
+ 'flat',
+ '--component-class',
+ '@glimmer/component',
+ 'foo',
+ ],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
+
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('app/bar/baz/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/bar/baz/foo/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- path: 'bar/baz/',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
@@ -456,79 +120,13 @@ describe('Blueprint: component', function() {
);
});
- it('component x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/x-foo/component.js')).to.equal(fixture('component/component-dash.js'));
-
- expect(_file('app/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo.js --pod', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--pod'], _file => {
- expect(_file('app/components/x-foo.js/component.js')).to.not.exist;
- expect(_file('app/components/x-foo.js/template.hbs')).to.not.exist;
- expect(_file('tests/integration/components/x-foo.js/component-test.js')).to.not.exist;
-
- expect(_file('app/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('app/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('component foo --pod', function() {
- return emberGenerateDestroy(['component', 'foo', '--pod'], _file => {
- expect(_file('app/pods/components/foo/component.js')).to.equal(
- fixture('component/component.js')
- );
-
- expect(_file('app/pods/components/foo/template.hbs')).to.equal('{{yield}}');
+ it('component foo --component-structure=flat', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'flat', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/components/foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
component: 'foo',
@@ -536,186 +134,110 @@ describe('Blueprint: component', function() {
},
})
);
- });
- });
-
- it('component x-foo --pod', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod'], _file => {
- expect(_file('app/pods/components/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
-
- expect(_file('app/pods/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/pods/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo --pod', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod'], _file => {
- expect(_file('app/pods/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ }
+ );
+ });
- expect(_file('app/pods/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
+ it('component foo --component-structure=nested', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'nested', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo/index.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/components/foo/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
- });
- });
-
- it('component x-foo --pod --path foo', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '--path', 'foo'], _file => {
- expect(_file('app/pods/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
+ }
+ );
+ });
- expect(_file('app/pods/foo/x-foo/template.hbs')).to.equal('{{yield}}');
+ it('component foo --component-structure=classic', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-structure', 'classic', 'foo'],
+ (_file) => {
+ expect(_file('app/templates/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/foo/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'foo/',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
- });
- });
-
- it('component foo/x-foo --pod --path bar', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod', '--path', 'bar'], _file => {
- expect(_file('app/pods/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/pods/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
+ }
+ );
+ });
- expect(_file('tests/integration/pods/bar/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- path: 'bar/',
- },
- })
- );
- });
- });
+ it('component foo --component-class=@ember/component', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@ember/component', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(emberComponentContents);
- it('component x-foo --pod --path bar/foo', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '--path', 'bar/foo'], _file => {
- expect(_file('app/pods/bar/foo/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('app/pods/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/bar/foo/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- path: 'bar/foo/',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
- });
- });
-
- it('component foo/x-foo --pod --path bar/baz', function() {
- return emberGenerateDestroy(
- ['component', 'foo/x-foo', '--pod', '--path', 'bar/baz'],
- _file => {
- expect(_file('app/pods/bar/baz/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
-
- expect(_file('app/pods/bar/baz/foo/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('tests/integration/pods/bar/baz/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- path: 'bar/baz/',
- },
- })
- );
- }
- );
- });
+ }
+ );
+ });
- it('component x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/pods/x-foo/component.js')).to.equal(
- fixture('component/component-dash.js')
- );
+ it('component foo --component-class=@glimmer/component', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@glimmer/component', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(glimmerComponentContents);
- expect(_file('app/pods/x-foo/template.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
- });
- });
+ }
+ );
+ });
- it('component foo/x-foo --pod -no-path', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--pod', '-no-path'], _file => {
- expect(_file('app/pods/foo/x-foo/component.js')).to.equal(
- fixture('component/component-nested.js')
- );
+ it('component foo --component-class=@ember/component/template-only', function () {
+ return emberGenerateDestroy(
+ ['component', '--component-class', '@ember/component/template-only', 'foo'],
+ (_file) => {
+ expect(_file('app/components/foo.js')).to.equal(templateOnlyContents);
- expect(_file('app/pods/foo/x-foo/template.hbs')).to.equal('{{yield}}');
+ expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/pods/foo/x-foo/component-test.js')).to.equal(
+ expect(_file('tests/integration/components/foo-test.js')).to.equal(
fixture('component-test/default-template.js', {
replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
+ component: 'foo',
+ componentInvocation: 'Foo',
},
})
);
- });
- });
- });
- });
-
- describe('in app - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
+ }
+ );
});
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
+ it('component foo --no-component-class', function () {
+ return emberGenerateDestroy(['component', '--no-component-class', 'foo'], (_file) => {
expect(_file('app/components/foo.js')).to.not.exist;
+
expect(_file('app/components/foo.hbs')).to.equal('{{yield}}');
expect(_file('tests/integration/components/foo-test.js')).to.equal(
@@ -729,8 +251,8 @@ describe('Blueprint: component', function() {
});
});
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
+ it('component x-foo', function () {
+ return emberGenerateDestroy(['component', 'x-foo'], (_file) => {
expect(_file('app/components/x-foo.js')).to.not.exist;
expect(_file('app/components/x-foo.hbs')).to.equal('{{yield}}');
@@ -745,8 +267,8 @@ describe('Blueprint: component', function() {
});
});
- it('component x-foo.js', function() {
- return emberGenerateDestroy(['component', 'x-foo.js'], _file => {
+ it('component x-foo.js', function () {
+ return emberGenerateDestroy(['component', 'x-foo.js'], (_file) => {
expect(_file('app/components/x-foo.js')).to.not.exist;
expect(_file('app/components/x-foo.js.js')).to.not.exist;
expect(_file('app/templates/components/x-foo.js.hbs')).to.not.exist;
@@ -765,8 +287,8 @@ describe('Blueprint: component', function() {
});
});
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
+ it('component foo/x-foo', function () {
+ return emberGenerateDestroy(['component', 'foo/x-foo'], (_file) => {
expect(_file('app/components/foo/x-foo.js')).to.not.exist;
expect(_file('app/components/foo/x-foo.hbs')).to.equal('{{yield}}');
@@ -781,10 +303,10 @@ describe('Blueprint: component', function() {
});
});
- it('component foo/x-foo --component-class="@glimmer/component"', function() {
+ it('component foo/x-foo --component-class="@glimmer/component"', function () {
return emberGenerateDestroy(
['component', 'foo/x-foo', '--component-class', '@glimmer/component'],
- _file => {
+ (_file) => {
expect(_file('app/components/foo/x-foo.js')).to.equal(
glimmerComponentContents.replace('FooComponent', 'FooXFooComponent')
);
@@ -799,192 +321,167 @@ describe('Blueprint: component', function() {
})
);
}
- );
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
- expect(_file('addon/components/foo.js')).to.equal(fixture('component/component-addon.js'));
-
- expect(_file('addon/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo';"
- );
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- });
- });
-
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
-
- expect(_file('addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo.js', function() {
- return emberGenerateDestroy(['component', 'x-foo.js'], _file => {
- expect(_file('addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('addon/templates/components/x-foo.js.hbs')).to.not.exist;
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo.js-test.js')).to.not.exist;
-
- expect(_file('addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
-
- expect(_file('addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
- expect(_file('addon/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
-
- expect(_file('addon/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('app/components/foo/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo';"
- );
-
- expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- });
+ );
});
- it('component x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
+ setupPodConfig({ podModulePrefix: true });
+ });
- expect(_file('tests/dummy/app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ it('component foo --pod', function () {
+ return emberGenerateDestroy(['component', 'foo', '--pod'], (_file) => {
+ expect(_file('app/pods/components/foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('app/components/x-foo.js')).to.not.exist;
+ expect(_file('tests/integration/pods/components/foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo',
+ componentInvocation: 'Foo',
+ },
+ })
+ );
+ });
+ });
- expect(_file('tests/unit/components/x-foo-test.js')).to.not.exist;
+ it('component x-foo --pod', function () {
+ return emberGenerateDestroy(['component', 'x-foo', '--pod'], (_file) => {
+ expect(_file('app/pods/components/x-foo/template.hbs')).to.equal('{{yield}}');
+
+ expect(_file('tests/integration/pods/components/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'x-foo',
+ componentInvocation: 'XFoo',
+ },
+ })
+ );
+ });
});
- });
- it('component foo/x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
+ it('component foo/x-foo --pod', function () {
+ return emberGenerateDestroy(['component', 'foo/x-foo', '--pod'], (_file) => {
+ expect(_file('app/pods/components/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/dummy/app/templates/components/foo/x-foo.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/integration/pods/components/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo/x-foo',
+ componentInvocation: 'Foo::XFoo',
+ },
+ })
+ );
+ });
+ });
- expect(_file('app/components/foo/x-foo.js')).to.not.exist;
+ it('component x-foo --pod --path foo', function () {
+ return emberGenerateDestroy(['component', 'x-foo', '--pod', '--path', 'foo'], (_file) => {
+ expect(_file('app/pods/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/unit/components/foo/x-foo-test.js')).to.not.exist;
+ expect(_file('tests/integration/pods/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'x-foo',
+ componentInvocation: 'XFoo',
+ path: 'foo/',
+ },
+ })
+ );
+ });
});
- });
- it('component x-foo.js --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/dummy/app/templates/components/x-foo.js.hbs')).to.not.exist;
- expect(_file('app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/unit/components/x-foo.js-test.js')).to.not.exist;
+ it('component foo/x-foo --pod --path bar', function () {
+ return emberGenerateDestroy(
+ ['component', 'foo/x-foo', '--pod', '--path', 'bar'],
+ (_file) => {
+ expect(_file('app/pods/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/dummy/app/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
+ expect(_file('tests/integration/pods/bar/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo/x-foo',
+ componentInvocation: 'Foo::XFoo',
+ path: 'bar/',
+ },
+ })
+ );
+ }
);
+ });
- expect(_file('tests/dummy/app/templates/components/x-foo.hbs')).to.equal('{{yield}}');
+ it('component x-foo --pod --path bar/foo', function () {
+ return emberGenerateDestroy(
+ ['component', 'x-foo', '--pod', '--path', 'bar/foo'],
+ (_file) => {
+ expect(_file('app/pods/bar/foo/x-foo/template.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/integration/pods/bar/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'x-foo',
+ componentInvocation: 'XFoo',
+ path: 'bar/foo/',
+ },
+ })
+ );
+ }
+ );
+ });
- expect(_file('app/components/x-foo.js')).to.not.exist;
+ it('component foo/x-foo --pod --path bar/baz', function () {
+ return emberGenerateDestroy(
+ ['component', 'foo/x-foo', '--pod', '--path', 'bar/baz'],
+ (_file) => {
+ expect(_file('app/pods/bar/baz/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/unit/components/x-foo-test.js')).to.not.exist;
+ expect(_file('tests/integration/pods/bar/baz/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo/x-foo',
+ componentInvocation: 'Foo::XFoo',
+ path: 'bar/baz/',
+ },
+ })
+ );
+ }
+ );
});
- });
- it('component x-foo --pod', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--pod'], _file => {
- expect(_file('addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
+ it('component x-foo --pod -no-path', function () {
+ return emberGenerateDestroy(['component', 'x-foo', '--pod', '-no-path'], (_file) => {
+ expect(_file('app/pods/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('addon/components/x-foo/template.hbs')).to.equal('{{yield}}');
+ expect(_file('tests/integration/pods/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'x-foo',
+ componentInvocation: 'XFoo',
+ },
+ })
+ );
+ });
+ });
- expect(_file('app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
+ it('component foo/x-foo --pod -no-path', function () {
+ return emberGenerateDestroy(['component', 'foo/x-foo', '--pod', '-no-path'], (_file) => {
+ expect(_file('app/pods/foo/x-foo/template.hbs')).to.equal('{{yield}}');
- expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
+ expect(_file('tests/integration/pods/foo/x-foo/component-test.js')).to.equal(
+ fixture('component-test/default-template.js', {
+ replace: {
+ component: 'foo/x-foo',
+ componentInvocation: 'Foo::XFoo',
+ },
+ })
+ );
+ });
});
});
});
- describe('in addon - octane', function() {
+ describe('in addon - octane', function () {
enableOctane();
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -995,8 +492,8 @@ describe('Blueprint: component', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component foo', function() {
- return emberGenerateDestroy(['component', 'foo'], _file => {
+ it('component foo', function () {
+ return emberGenerateDestroy(['component', 'foo'], (_file) => {
expect(_file('addon/components/foo.js')).to.not.exist;
expect(_file('addon/components/foo.hbs')).to.equal('{{yield}}');
@@ -1018,8 +515,8 @@ describe('Blueprint: component', function() {
});
});
- it('component x-foo', function() {
- return emberGenerateDestroy(['component', 'x-foo'], _file => {
+ it('component x-foo', function () {
+ return emberGenerateDestroy(['component', 'x-foo'], (_file) => {
expect(_file('addon/components/x-foo.js')).to.not.exist;
expect(_file('addon/components/x-foo.hbs')).to.equal('{{yield}}');
@@ -1042,8 +539,8 @@ describe('Blueprint: component', function() {
});
});
- it('component foo/x-foo', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo'], _file => {
+ it('component foo/x-foo', function () {
+ return emberGenerateDestroy(['component', 'foo/x-foo'], (_file) => {
expect(_file('addon/components/foo/x-foo.js')).to.not.exist;
expect(_file('addon/components/foo/x-foo.hbs')).to.equal('{{yield}}');
@@ -1065,8 +562,8 @@ describe('Blueprint: component', function() {
});
});
- it('component x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--dummy'], _file => {
+ it('component x-foo --dummy', function () {
+ return emberGenerateDestroy(['component', 'x-foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/components/x-foo.js')).to.not.exist;
expect(_file('tests/dummy/app/components/x-foo.hbs')).to.equal('{{yield}}');
@@ -1079,8 +576,8 @@ describe('Blueprint: component', function() {
});
});
- it('component foo/x-foo --dummy', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--dummy'], _file => {
+ it('component foo/x-foo --dummy', function () {
+ return emberGenerateDestroy(['component', 'foo/x-foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/components/foo/x-foo.js')).to.not.exist;
expect(_file('tests/dummy/app/components/foo/x-foo.hbs')).to.equal('{{yield}}');
@@ -1095,207 +592,10 @@ describe('Blueprint: component', function() {
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'in-repo-addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('component foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/foo.js')).to.equal(
- fixture('component/component-addon.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo';"
- );
-
- expect(_file('tests/integration/components/foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo',
- componentInvocation: 'Foo',
- },
- })
- );
- });
- });
-
- it('component x-foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo.js', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/x-foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/addon/templates/components/x-foo.js.hbs')).to.not.exist;
- expect(_file('lib/my-addon/app/components/x-foo.js.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo-test.js.js')).to.not.exist;
-
- expect(_file('lib/my-addon/addon/components/x-foo.js')).to.equal(
- fixture('component/component-addon-dash.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo';"
- );
-
- expect(_file('tests/integration/components/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- });
- });
-
- it('component foo/x-foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'foo/x-foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/components/foo/x-foo.js')).to.equal(
- fixture('component/component-addon-nested.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/components/foo/x-foo.hbs')).to.equal(
- '{{yield}}'
- );
-
- expect(_file('lib/my-addon/app/components/foo/x-foo.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo';"
- );
-
- expect(_file('tests/integration/components/foo/x-foo-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- });
- });
-
- it('component x-foo --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component', 'x-foo', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
-
- expect(_file('lib/my-addon/addon/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
-
- expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- }
- );
- });
-
- it('component x-foo.js --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component', 'x-foo.js', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/x-foo/component.js.js')).to.not.exist;
- expect(_file('lib/my-addon/addon/components/x-foo/template.js.hbs')).to.not.exist;
- expect(_file('lib/my-addon/app/components/x-foo/component.js.js')).to.not.exist;
- expect(_file('tests/integration/components/x-foo/component-test.js.js')).to.not.exist;
-
- expect(_file('lib/my-addon/addon/components/x-foo/component.js')).to.equal(
- fixture('component/component-addon-dash-pod.js')
- );
-
- expect(_file('lib/my-addon/addon/components/x-foo/template.hbs')).to.equal('{{yield}}');
-
- expect(_file('lib/my-addon/app/components/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/x-foo/component';"
- );
-
- expect(_file('tests/integration/components/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'x-foo',
- componentInvocation: 'XFoo',
- },
- })
- );
- }
- );
- });
-
- it('component foo/x-foo --in-repo-addon=my-addon --pod', function() {
- return emberGenerateDestroy(
- ['component', 'foo/x-foo', '--in-repo-addon=my-addon', '--pod'],
- _file => {
- expect(_file('lib/my-addon/addon/components/foo/x-foo/component.js')).to.equal(
- fixture('component/component-addon-nested-pod.js')
- );
-
- expect(_file('lib/my-addon/addon/components/foo/x-foo/template.hbs')).to.equal(
- '{{yield}}'
- );
-
- expect(_file('lib/my-addon/app/components/foo/x-foo/component.js')).to.contain(
- "export { default } from 'my-addon/components/foo/x-foo/component';"
- );
-
- expect(_file('tests/integration/components/foo/x-foo/component-test.js')).to.equal(
- fixture('component-test/default-template.js', {
- replace: {
- component: 'foo/x-foo',
- componentInvocation: 'Foo::XFoo',
- },
- })
- );
- }
- );
- });
- });
-
- describe('in in-repo-addon - octane', function() {
+ describe('in in-repo-addon - octane', function () {
enableOctane();
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -1306,8 +606,8 @@ describe('Blueprint: component', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('component foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('component foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['component', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/components/foo.js')).to.not.exist;
expect(_file('lib/my-addon/addon/components/foo.hbs')).to.equal('{{yield}}');
expect(_file('lib/my-addon/addon/templates/components/foo.hbs')).to.not.exist;
@@ -1330,8 +630,8 @@ describe('Blueprint: component', function() {
});
});
- it('component x-foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['component', 'x-foo', '--in-repo-addon=my-addon'], _file => {
+ it('component x-foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['component', 'x-foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/components/x-foo.js')).to.not.exist;
expect(_file('lib/my-addon/addon/components/x-foo.hbs')).to.equal('{{yield}}');
expect(_file('lib/my-addon/addon/templates/components/x-foo.hbs')).to.not.exist;
diff --git a/node-tests/blueprints/controller-test-test.js b/node-tests/blueprints/controller-test-test.js
index a50cb2cf3ba..4d301cae653 100644
--- a/node-tests/blueprints/controller-test-test.js
+++ b/node-tests/blueprints/controller-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: controller-test', function() {
+describe('Blueprint: controller-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,16 +29,16 @@ describe('Blueprint: controller-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/default.js')
);
});
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
+ it('controller-test foo/bar', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/default-nested.js')
);
@@ -49,8 +46,8 @@ describe('Blueprint: controller-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -58,16 +55,16 @@ describe('Blueprint: controller-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/rfc232.js')
);
});
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
+ it('controller-test foo/bar', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/rfc232-nested.js')
);
@@ -75,8 +72,8 @@ describe('Blueprint: controller-test', function() {
});
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.11.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -84,16 +81,16 @@ describe('Blueprint: controller-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.11.0');
});
- it('controller-test foo for mocha', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
+ it('controller-test foo for mocha', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/mocha.js')
);
});
});
- it('controller-test foo/bar for mocha', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
+ it('controller-test foo/bar for mocha', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/mocha-nested.js')
);
@@ -101,8 +98,8 @@ describe('Blueprint: controller-test', function() {
});
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.12.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -110,16 +107,16 @@ describe('Blueprint: controller-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.12.0');
});
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/mocha-0.12.js')
);
});
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
+ it('controller-test foo/bar', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/mocha-0.12-nested.js')
);
@@ -127,22 +124,25 @@ describe('Blueprint: controller-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/mocha-rfc232.js')
);
});
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
+ it('controller-test foo/bar', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/mocha-rfc232-nested.js')
);
@@ -151,15 +151,13 @@ describe('Blueprint: controller-test', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
+ describe('in addon', function () {
+ beforeEach(function () {
+ return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -167,182 +165,49 @@ describe('Blueprint: controller-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
fixture('controller-test/default.js')
);
});
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
+ it('controller-test foo/bar', function () {
+ return emberGenerateDestroy(['controller-test', 'foo/bar'], (_file) => {
+ expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
fixture('controller-test/default-nested.js')
);
});
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/rfc232.js')
- );
- });
- });
-
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/rfc232-nested.js')
- );
- });
- });
- });
-
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-mocha', '0.11.0');
- });
-
- it('controller-test foo for mocha', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/mocha.js')
- );
- });
- });
-
- it('controller-test foo/bar for mocha', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/mocha-nested.js')
+ describe('with ember-qunit (default)', function () {
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
+ fixture('controller-test/rfc232-addon.js')
);
});
});
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
+ { name: 'ember-mocha', dev: true },
]);
- generateFakePackageManifest('ember-cli-mocha', '0.12.0');
- });
-
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/mocha-0.12.js')
- );
- });
+ generateFakePackageManifest('ember-mocha', '0.16.2');
});
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/mocha-0.12-nested.js')
- );
- });
- });
- });
-
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/mocha-rfc232.js')
- );
- });
- });
-
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/mocha-rfc232-nested.js')
+ it('controller-test foo', function () {
+ return emberGenerateDestroy(['controller-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
+ fixture('controller-test/mocha-rfc232-addon.js')
);
});
});
});
});
-
- describe('in addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller-test foo', function() {
- return emberGenerateDestroy(['controller-test', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller-test foo/bar', function() {
- return emberGenerateDestroy(['controller-test', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
- });
- });
});
diff --git a/node-tests/blueprints/controller-test.js b/node-tests/blueprints/controller-test.js
index c77eddf2e80..854b26f9edc 100644
--- a/node-tests/blueprints/controller-test.js
+++ b/node-tests/blueprints/controller-test.js
@@ -7,7 +7,6 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
@@ -15,14 +14,15 @@ const generateFakePackageManifest = require('../helpers/generate-fake-package-ma
const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const enableOctane = setupTestEnvironment.enableOctane;
-describe('Blueprint: controller', function() {
+describe('Blueprint: controller', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -33,8 +33,8 @@ describe('Blueprint: controller', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
+ it('controller foo', function () {
+ return emberGenerateDestroy(['controller', 'foo'], (_file) => {
expect(_file('app/controllers/foo.js')).to.equal(fixture('controller/controller.js'));
expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
@@ -43,8 +43,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
+ it('controller foo.js', function () {
+ return emberGenerateDestroy(['controller', 'foo.js'], (_file) => {
expect(_file('app/controllers/foo.js.js')).to.not.exist;
expect(_file('tests/unit/controllers/foo.js-test.js')).to.not.exist;
@@ -56,8 +56,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
+ it('controller foo/bar', function () {
+ return emberGenerateDestroy(['controller', 'foo/bar'], (_file) => {
expect(_file('app/controllers/foo/bar.js')).to.equal(
fixture('controller/controller-nested.js')
);
@@ -68,8 +68,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo --pod', function() {
- return emberGenerateDestroy(['controller', 'foo', '--pod'], _file => {
+ it('controller foo --pod', function () {
+ return emberGenerateDestroy(['controller', 'foo', '--pod'], (_file) => {
expect(_file('app/foo/controller.js')).to.equal(fixture('controller/controller.js'));
expect(_file('tests/unit/foo/controller-test.js')).to.equal(
@@ -78,8 +78,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js --pod', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--pod'], _file => {
+ it('controller foo.js --pod', function () {
+ return emberGenerateDestroy(['controller', 'foo.js', '--pod'], (_file) => {
expect(_file('app/foo.js/controller.js')).to.not.exist;
expect(_file('tests/unit/foo.js/controller-test.js')).to.not.exist;
@@ -91,8 +91,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar --pod', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--pod'], _file => {
+ it('controller foo/bar --pod', function () {
+ return emberGenerateDestroy(['controller', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/foo/bar/controller.js')).to.equal(
fixture('controller/controller-nested.js')
);
@@ -103,13 +103,14 @@ describe('Blueprint: controller', function() {
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ enableOctane();
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('controller foo --pod podModulePrefix', function() {
- return emberGenerateDestroy(['controller', 'foo', '--pod'], _file => {
+ it('controller foo --pod podModulePrefix', function () {
+ return emberGenerateDestroy(['controller', 'foo', '--pod'], (_file) => {
expect(_file('app/pods/foo/controller.js')).to.equal(fixture('controller/controller.js'));
expect(_file('tests/unit/pods/foo/controller-test.js')).to.equal(
@@ -118,11 +119,10 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js --pod podModulePrefix', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--pod'], _file => {
+ it('controller foo.js --pod podModulePrefix', function () {
+ return emberGenerateDestroy(['controller', 'foo.js', '--pod'], (_file) => {
expect(_file('app/pods/foo.js/controller.js')).to.not.exist;
expect(_file('tests/unit/pods/foo.js/controller-test.js')).to.not.exist;
-
expect(_file('app/pods/foo/controller.js')).to.equal(fixture('controller/controller.js'));
expect(_file('tests/unit/pods/foo/controller-test.js')).to.equal(
@@ -131,8 +131,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar --pod podModulePrefix', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--pod'], _file => {
+ it('controller foo/bar --pod podModulePrefix', function () {
+ return emberGenerateDestroy(['controller', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/pods/foo/bar/controller.js')).to.equal(
fixture('controller/controller-nested.js')
);
@@ -145,8 +145,10 @@ describe('Blueprint: controller', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -157,8 +159,8 @@ describe('Blueprint: controller', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
+ it('controller foo', function () {
+ return emberGenerateDestroy(['controller', 'foo'], (_file) => {
expect(_file('addon/controllers/foo.js')).to.equal(fixture('controller/controller.js'));
expect(_file('app/controllers/foo.js')).to.contain(
@@ -171,8 +173,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
+ it('controller foo.js', function () {
+ return emberGenerateDestroy(['controller', 'foo.js'], (_file) => {
expect(_file('addon/controllers/foo.js.js')).to.not.exist;
expect(_file('app/controllers/foo.js.js')).to.not.exist;
expect(_file('tests/unit/controllers/foo.js-test.js')).to.not.exist;
@@ -189,8 +191,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
+ it('controller foo/bar', function () {
+ return emberGenerateDestroy(['controller', 'foo/bar'], (_file) => {
expect(_file('addon/controllers/foo/bar.js')).to.equal(
fixture('controller/controller-nested.js')
);
@@ -205,8 +207,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo', '--dummy'], _file => {
+ it('controller foo --dummy', function () {
+ return emberGenerateDestroy(['controller', 'foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/controllers/foo.js')).to.equal(
fixture('controller/controller.js')
);
@@ -217,8 +219,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--dummy'], _file => {
+ it('controller foo.js --dummy', function () {
+ return emberGenerateDestroy(['controller', 'foo.js', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/controllers/foo.js.js')).to.not.exist;
expect(_file('tests/dummy/app/controllers/foo.js')).to.equal(
@@ -231,8 +233,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--dummy'], _file => {
+ it('controller foo/bar --dummy', function () {
+ return emberGenerateDestroy(['controller', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/controllers/foo/bar.js')).to.equal(
fixture('controller/controller-nested.js')
);
@@ -244,375 +246,9 @@ describe('Blueprint: controller', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
- expect(_file('src/ui/routes/foo.js/controller.js')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/controller-test.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller.js')).to.equal(
- fixture('controller/controller-nested.js')
- );
-
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('controller foo --pod podModulePrefix', function() {
- return expectError(
- emberGenerateDestroy(['controller', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
-
- expect(_file('app/controllers/foo.js')).to.not.exist;
- });
- });
-
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
- expect(_file('src/ui/routes/foo.js/controller.js')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/controller-test.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
-
- expect(_file('app/controllers/foo.js')).to.not.exist;
- });
- });
-
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/controller.js')).to.equal(
- fixture('controller/controller-nested.js')
- );
-
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
-
- expect(_file('app/controllers/foo/bar.js')).to.not.exist;
- });
- });
-
- it('controller foo --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.not.exist;
- });
- });
-
- it('controller foo.js --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo.js/controller.js')).to.not.exist;
-
- expect(_file('tests/dummy/src/ui/routes/foo/controller.js')).to.equal(
- fixture('controller/controller.js')
- );
-
- expect(_file('src/ui/routes/foo/controller.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/controller-test.js')).to.not.exist;
- });
- });
-
- it('controller foo/bar --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/bar/controller.js')).to.equal(
- fixture('controller/controller-nested.js')
- );
-
- expect(_file('src/ui/routes/foo/bar/controller.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/bar/controller-test.js')).to.not.exist;
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('controller foo --pod podModulePrefix', function() {
- return expectError(
- emberGenerateDestroy(['controller', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
- });
-
- describe('in app - octane', function() {
+ describe('in in-repo-addon', function () {
enableOctane();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
- expect(_file('app/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
- expect(_file('app/controllers/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/controllers/foo.js-test.js')).to.not.exist;
-
- expect(_file('app/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
- expect(_file('app/controllers/foo/bar.js')).to.equal(
- fixture('controller/native-controller-nested.js')
- );
-
- expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('controller foo --pod podModulePrefix', function() {
- return emberGenerateDestroy(['controller', 'foo', '--pod'], _file => {
- expect(_file('app/pods/foo/controller.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('tests/unit/pods/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo.js --pod podModulePrefix', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--pod'], _file => {
- expect(_file('app/pods/foo/controller.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('tests/unit/pods/foo/controller-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
- });
- });
-
- describe('in addon - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('controller foo', function() {
- return emberGenerateDestroy(['controller', 'foo'], _file => {
- expect(_file('addon/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('app/controllers/foo.js')).to.contain(
- "export { default } from 'my-addon/controllers/foo';"
- );
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo.js', function() {
- return emberGenerateDestroy(['controller', 'foo.js'], _file => {
- expect(_file('addon/controllers/foo.js.js')).to.not.exist;
- expect(_file('app/controllers/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/controllers/foo.js-test.js')).to.not.exist;
-
- expect(_file('addon/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('app/controllers/foo.js')).to.contain(
- "export { default } from 'my-addon/controllers/foo';"
- );
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.equal(
- fixture('controller-test/default.js')
- );
- });
- });
-
- it('controller foo/bar', function() {
- return emberGenerateDestroy(['controller', 'foo/bar'], _file => {
- expect(_file('addon/controllers/foo/bar.js')).to.equal(
- fixture('controller/native-controller-nested.js')
- );
-
- expect(_file('app/controllers/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/controllers/foo/bar';"
- );
-
- expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
- });
-
- it('controller foo --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('app/controllers/foo-test.js')).to.not.exist;
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.not.exist;
- });
- });
-
- it('controller foo.js --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/controllers/foo.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/app/controllers/foo.js')).to.equal(
- fixture('controller/native-controller.js')
- );
-
- expect(_file('app/controllers/foo-test.js')).to.not.exist;
-
- expect(_file('tests/unit/controllers/foo-test.js')).to.not.exist;
- });
- });
-
- it('controller foo/bar --dummy', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/app/controllers/foo/bar.js')).to.equal(
- fixture('controller/native-controller-nested.js')
- );
-
- expect(_file('app/controllers/foo/bar.js')).to.not.exist;
-
- expect(_file('tests/unit/controllers/foo/bar-test.js')).to.not.exist;
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -623,8 +259,8 @@ describe('Blueprint: controller', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('controller foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['controller', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('controller foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['controller', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/controllers/foo.js')).to.equal(
fixture('controller/controller.js')
);
@@ -639,8 +275,8 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['controller', 'foo.js', '--in-repo-addon=my-addon'], _file => {
+ it('controller foo.js --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['controller', 'foo.js', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/controllers/foo.js.js')).to.not.exist;
expect(_file('lib/my-addon/app/controllers/foo.js.js')).to.not.exist;
expect(_file('tests/unit/controllers/foo.js-test.js')).to.not.exist;
@@ -659,20 +295,23 @@ describe('Blueprint: controller', function() {
});
});
- it('controller foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['controller', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/controllers/foo/bar.js')).to.equal(
- fixture('controller/controller-nested.js')
- );
+ it('controller foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(
+ ['controller', 'foo/bar', '--in-repo-addon=my-addon'],
+ (_file) => {
+ expect(_file('lib/my-addon/addon/controllers/foo/bar.js')).to.equal(
+ fixture('controller/controller-nested.js')
+ );
- expect(_file('lib/my-addon/app/controllers/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/controllers/foo/bar';"
- );
+ expect(_file('lib/my-addon/app/controllers/foo/bar.js')).to.contain(
+ "export { default } from 'my-addon/controllers/foo/bar';"
+ );
- expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
- fixture('controller-test/default-nested.js')
- );
- });
+ expect(_file('tests/unit/controllers/foo/bar-test.js')).to.equal(
+ fixture('controller-test/default-nested.js')
+ );
+ }
+ );
});
});
});
diff --git a/node-tests/blueprints/helper-addon-test.js b/node-tests/blueprints/helper-addon-test.js
index ba6db854fa0..5e8c755fa96 100644
--- a/node-tests/blueprints/helper-addon-test.js
+++ b/node-tests/blueprints/helper-addon-test.js
@@ -10,22 +10,22 @@ const expect = chai.expect;
const fixture = require('../helpers/fixture');
-describe('Blueprint: helper-addon', function() {
+describe('Blueprint: helper-addon', function () {
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('helper-addon foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-addon', 'foo/bar-baz'], _file => {
+ it('helper-addon foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-addon', 'foo/bar-baz'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper-addon.js'));
});
});
- it('helper-addon foo/bar-baz --pod', function() {
- return emberGenerateDestroy(['helper-addon', 'foo/bar-baz', '--pod'], _file => {
+ it('helper-addon foo/bar-baz --pod', function () {
+ return emberGenerateDestroy(['helper-addon', 'foo/bar-baz', '--pod'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper-addon.js'));
});
});
diff --git a/node-tests/blueprints/helper-test-test.js b/node-tests/blueprints/helper-test-test.js
index 713d539ea57..8edbdc5decb 100644
--- a/node-tests/blueprints/helper-test-test.js
+++ b/node-tests/blueprints/helper-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: helper-test', function() {
+describe('Blueprint: helper-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,16 +29,16 @@ describe('Blueprint: helper-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
+ it('helper-test foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
);
});
});
- it('helper-test foo/bar-baz --integration', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--integration'], _file => {
+ it('helper-test foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
);
@@ -49,8 +46,8 @@ describe('Blueprint: helper-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -58,25 +55,17 @@ describe('Blueprint: helper-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
+ it('helper-test foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/rfc232.js')
);
});
});
-
- it('helper-test foo/bar-baz --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('tests/unit/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/rfc232-unit.js')
- );
- });
- });
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.11.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -84,25 +73,17 @@ describe('Blueprint: helper-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.11.0');
});
- it('helper-test foo/bar-baz --integration', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
+ it('helper-test foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/mocha.js')
);
});
});
-
- it('helper-test foo/bar-baz --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('tests/unit/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-unit.js')
- );
- });
- });
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.12.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -110,56 +91,41 @@ describe('Blueprint: helper-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.12.0');
});
- it('helper-test foo/bar-baz for mocha', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
+ it('helper-test foo/bar-baz for mocha', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/mocha-0.12.js')
);
});
});
-
- it('helper-test foo/bar-baz for mocha --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('tests/unit/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-0.12-unit.js')
- );
- });
- });
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('helper-test foo/bar-baz for mocha', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
+ it('helper-test foo/bar-baz for mocha', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/mocha-rfc232.js')
);
});
});
-
- it('helper-test foo/bar-baz for mocha --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('tests/unit/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-rfc232-unit.js')
- );
- });
- });
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
+ describe('in addon', function () {
+ beforeEach(function () {
+ return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -167,172 +133,41 @@ describe('Blueprint: helper-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper-test foo/bar-baz --integration', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--integration'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
+ it('helper-test foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], (_file) => {
+ expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
);
});
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/rfc232.js')
- );
- });
- });
-
- it('helper-test foo/bar-baz --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/rfc232-unit.js')
+ describe('with ember-qunit (default)', function () {
+ it('helper-test foo', function () {
+ return emberGenerateDestroy(['helper-test', 'foo'], (_file) => {
+ expect(_file('tests/integration/helpers/foo-test.js')).to.equal(
+ fixture('helper-test/rfc232-addon.js')
);
});
});
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
+ { name: 'ember-mocha', dev: true },
]);
- generateFakePackageManifest('ember-cli-mocha', '0.11.0');
- });
-
- it('helper-test foo/bar-baz --integration', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha.js')
- );
- });
+ generateFakePackageManifest('ember-mocha', '0.16.2');
});
- it('helper-test foo/bar-baz --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-unit.js')
+ it('helper-test foo', function () {
+ return emberGenerateDestroy(['helper-test', 'foo'], (_file) => {
+ expect(_file('tests/integration/helpers/foo-test.js')).to.equal(
+ fixture('helper-test/mocha-rfc232-addon.js')
);
});
});
});
-
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-mocha', '0.12.0');
- });
-
- it('helper-test foo/bar-baz for mocha', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-0.12.js')
- );
- });
- });
-
- it('helper-test foo/bar-baz for mocha --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-0.12-unit.js')
- );
- });
- });
- });
-
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('helper-test foo/bar-baz for mocha', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-rfc232.js')
- );
- });
- });
-
- it('helper-test foo/bar-baz for mocha --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/mocha-rfc232-unit.js')
- );
- });
- });
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'addon' }).then(() => {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
- });
-
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' }).then(() => {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
- });
-
- it('helper-test foo/bar-baz', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper-test foo/bar-baz --unit', function() {
- return emberGenerateDestroy(['helper-test', 'foo/bar-baz', '--unit'], _file => {
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/module-unification/addon-unit.js')
- );
- });
- });
});
});
diff --git a/node-tests/blueprints/helper-test.js b/node-tests/blueprints/helper-test.js
index 0cc5ff0ba73..165687c2827 100644
--- a/node-tests/blueprints/helper-test.js
+++ b/node-tests/blueprints/helper-test.js
@@ -13,14 +13,11 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: helper', function() {
+describe('Blueprint: helper', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew().then(() => {
modifyPackages([
{ name: 'ember-qunit', delete: true },
@@ -30,8 +27,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => {
+ it('helper foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper.js'));
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
@@ -39,8 +36,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz.js', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js'], _file => {
+ it('helper foo/bar-baz.js', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz.js'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
@@ -51,17 +48,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz unit', function() {
- return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => {
- expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper.js'));
- expect(_file('tests/unit/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/unit.js')
- );
- });
- });
-
- it('helper foo/bar-baz --pod', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--pod'], _file => {
+ it('helper foo/bar-baz --pod', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz', '--pod'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper.js'));
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
@@ -69,8 +57,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz.js --pod', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--pod'], _file => {
+ it('helper foo/bar-baz.js --pod', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--pod'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
@@ -81,13 +69,13 @@ describe('Blueprint: helper', function() {
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('helper foo/bar-baz --pod', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--pod'], _file => {
+ it('helper foo/bar-baz --pod', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz', '--pod'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper.js'));
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
fixture('helper-test/integration.js')
@@ -95,8 +83,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz.js --pod', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--pod'], _file => {
+ it('helper foo/bar-baz.js --pod', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--pod'], (_file) => {
expect(_file('app/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
@@ -109,52 +97,8 @@ describe('Blueprint: helper', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew().then(() => {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
- });
-
- it('helper foo/bar-baz', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper foo/bar-baz.js', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js.js')).to.not.exist;
- expect(_file('src/ui/components/foo/bar-baz.js-test.js')).to.not.exist;
-
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper foo/bar-baz unit', function() {
- return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/unit.js')
- );
- });
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' }).then(() => {
modifyPackages([
{ name: 'ember-qunit', delete: true },
@@ -164,8 +108,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => {
+ it('helper foo/bar-baz', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz'], (_file) => {
expect(_file('addon/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper.js'));
expect(_file('app/helpers/foo/bar-baz.js')).to.equal(fixture('helper/helper-addon.js'));
expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
@@ -174,8 +118,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz.js', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js'], _file => {
+ it('helper foo/bar-baz.js', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz.js'], (_file) => {
expect(_file('addon/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('app/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
@@ -188,8 +132,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz --dummy', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--dummy'], _file => {
+ it('helper foo/bar-baz --dummy', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/helpers/foo/bar-baz.js')).to.equal(
fixture('helper/helper.js')
);
@@ -198,8 +142,8 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz.js --dummy', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--dummy'], _file => {
+ it('helper foo/bar-baz.js --dummy', function () {
+ return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/helpers/foo/bar-baz.js.js')).to.not.exist;
expect(_file('tests/dummy/app/helpers/foo/bar-baz.js')).to.equal(
@@ -211,72 +155,8 @@ describe('Blueprint: helper', function() {
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' }).then(() => {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
- });
-
- it('helper foo/bar-baz', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper foo/bar-baz unit', function() {
- return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/module-unification/addon-unit.js')
- );
- });
- });
-
- it('helper foo/bar-baz.js unit', function() {
- return emberGenerateDestroy(['helper', '--test-type=unit', 'foo/bar-baz'], _file => {
- expect(_file('src/ui/components/foo/bar-baz.js.js')).to.not.exist;
- expect(_file('src/ui/components/foo/bar-baz.js-test.js')).to.not.exist;
-
- expect(_file('src/ui/components/foo/bar-baz.js')).to.equal(fixture('helper/mu-helper.js'));
- expect(_file('src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/module-unification/addon-unit.js')
- );
- });
- });
-
- it('helper foo/bar-baz --dummy', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/components/foo/bar-baz.js')).to.equal(
- fixture('helper/mu-helper.js')
- );
- expect(_file('src/ui/components/foo/bar-baz.js')).to.not.exist;
- });
- });
-
- it('helper foo/bar-baz.js --dummy', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/components/foo/bar-baz.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/src/ui/components/foo/bar-baz.js')).to.equal(
- fixture('helper/mu-helper.js')
- );
- expect(_file('src/ui/components/foo/bar-baz.js')).to.not.exist;
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' }).then(() => {
modifyPackages([
{ name: 'ember-qunit', delete: true },
@@ -286,28 +166,10 @@ describe('Blueprint: helper', function() {
});
});
- it('helper foo/bar-baz --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/helpers/foo/bar-baz.js')).to.equal(
- fixture('helper/helper.js')
- );
- expect(_file('lib/my-addon/app/helpers/foo/bar-baz.js')).to.equal(
- fixture('helper/helper-addon.js')
- );
- expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
-
- it('helper foo/bar-baz.js --in-repo-addon=my-addon', function() {
+ it('helper foo/bar-baz --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
- ['helper', 'foo/bar-baz.js', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('lib/my-addon/addon/helpers/foo/bar-baz.js.js')).to.not.exist;
- expect(_file('lib/my-addon/app/helpers/foo/bar-baz.js.js')).to.not.exist;
- expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
-
+ ['helper', 'foo/bar-baz', '--in-repo-addon=my-addon'],
+ (_file) => {
expect(_file('lib/my-addon/addon/helpers/foo/bar-baz.js')).to.equal(
fixture('helper/helper.js')
);
@@ -320,58 +182,23 @@ describe('Blueprint: helper', function() {
}
);
});
- });
-
- describe('in in-repo-addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'in-repo-addon' }).then(() => {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
- });
-
- it('helper foo/bar-baz --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['helper', 'foo/bar-baz', '--in-repo-addon=my-addon'], _file => {
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js')).to.equal(
- fixture('helper/mu-helper.js')
- );
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
- );
- });
- });
- it('helper foo/bar-baz.js --in-repo-addon=my-addon', function() {
+ it('helper foo/bar-baz.js --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
['helper', 'foo/bar-baz.js', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js.js')).to.not.exist;
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js-test.js')).to.not.exist;
+ (_file) => {
+ expect(_file('lib/my-addon/addon/helpers/foo/bar-baz.js.js')).to.not.exist;
+ expect(_file('lib/my-addon/app/helpers/foo/bar-baz.js.js')).to.not.exist;
+ expect(_file('tests/integration/helpers/foo/bar-baz.js-test.js')).to.not.exist;
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js')).to.equal(
- fixture('helper/mu-helper.js')
- );
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/integration.js')
+ expect(_file('lib/my-addon/addon/helpers/foo/bar-baz.js')).to.equal(
+ fixture('helper/helper.js')
);
- }
- );
- });
-
- it('helper foo/bar-baz unit --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(
- ['helper', '--test-type=unit', 'foo/bar-baz', '--in-repo-addon=my-addon'],
- _file => {
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz.js')).to.equal(
- fixture('helper/mu-helper.js')
+ expect(_file('lib/my-addon/app/helpers/foo/bar-baz.js')).to.equal(
+ fixture('helper/helper-addon.js')
);
- expect(_file('packages/my-addon/src/ui/components/foo/bar-baz-test.js')).to.equal(
- fixture('helper-test/module-unification/addon-unit.js')
+ expect(_file('tests/integration/helpers/foo/bar-baz-test.js')).to.equal(
+ fixture('helper-test/integration.js')
);
}
);
diff --git a/node-tests/blueprints/initializer-addon-test.js b/node-tests/blueprints/initializer-addon-test.js
index 5f12c6dff66..bafe3336a95 100644
--- a/node-tests/blueprints/initializer-addon-test.js
+++ b/node-tests/blueprints/initializer-addon-test.js
@@ -8,24 +8,24 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-describe('Blueprint: initializer-addon', function() {
+describe('Blueprint: initializer-addon', function () {
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('initializer-addon foo', function() {
- return emberGenerateDestroy(['initializer-addon', 'foo'], _file => {
+ it('initializer-addon foo', function () {
+ return emberGenerateDestroy(['initializer-addon', 'foo'], (_file) => {
expect(_file('app/initializers/foo.js')).to.contain(
"export { default, initialize } from 'my-addon/initializers/foo';"
);
});
});
- it('initializer-addon foo --pod', function() {
- return emberGenerateDestroy(['initializer-addon', 'foo', '--pod'], _file => {
+ it('initializer-addon foo --pod', function () {
+ return emberGenerateDestroy(['initializer-addon', 'foo', '--pod'], (_file) => {
expect(_file('app/initializers/foo.js')).to.contain(
"export { default, initialize } from 'my-addon/initializers/foo';"
);
diff --git a/node-tests/blueprints/initializer-test-test.js b/node-tests/blueprints/initializer-test-test.js
index 89aa9b72e3e..2db53a16377 100644
--- a/node-tests/blueprints/initializer-test-test.js
+++ b/node-tests/blueprints/initializer-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: initializer-test', function() {
+describe('Blueprint: initializer-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,8 +29,8 @@ describe('Blueprint: initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
+ it('initializer-test foo', function () {
+ return emberGenerateDestroy(['initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/initializers/foo-test.js')).to.equal(
fixture('initializer-test/default.js')
);
@@ -41,8 +38,8 @@ describe('Blueprint: initializer-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -50,8 +47,8 @@ describe('Blueprint: initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
+ it('initializer-test foo', function () {
+ return emberGenerateDestroy(['initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/initializers/foo-test.js')).to.equal(
fixture('initializer-test/rfc232.js')
);
@@ -59,16 +56,16 @@ describe('Blueprint: initializer-test', function() {
});
});
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
]);
});
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
+ it('initializer-test foo', function () {
+ return emberGenerateDestroy(['initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/initializers/foo-test.js')).to.equal(
fixture('initializer-test/mocha.js')
);
@@ -76,14 +73,17 @@ describe('Blueprint: initializer-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
+ it('initializer-test foo', function () {
+ return emberGenerateDestroy(['initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/initializers/foo-test.js')).to.equal(
fixture('initializer-test/mocha-rfc232.js')
);
@@ -92,13 +92,13 @@ describe('Blueprint: initializer-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -106,8 +106,8 @@ describe('Blueprint: initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
+ it('initializer-test foo', function () {
+ return emberGenerateDestroy(['initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/initializers/foo-test.js')).to.equal(
fixture('initializer-test/dummy.js')
);
@@ -115,114 +115,4 @@ describe('Blueprint: initializer-test', function() {
});
});
});
-
- describe('in app – module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
- expect(_file('src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/default.js')
- );
- });
- });
- });
-
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
- expect(_file('src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/rfc232.js')
- );
- });
- });
- });
-
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- });
-
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
- expect(_file('src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/mocha.js')
- );
- });
- });
- });
-
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
- expect(_file('src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/mocha-rfc232.js')
- );
- });
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('initializer-test foo', function() {
- return emberGenerateDestroy(['initializer-test', 'foo'], _file => {
- expect(_file('src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/dummy.js')
- );
- });
- });
-
- it('initializer-test foo --dummy', function() {
- return emberGenerateDestroy(['initializer-test', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/initializers/foo-test.js')).to.equal(
- fixture('initializer-test/module-unification/dummy.js')
- );
- });
- });
- });
- });
});
diff --git a/node-tests/blueprints/initializer-test.js b/node-tests/blueprints/initializer-test.js
index 360a2f4afc0..29b4337e14b 100644
--- a/node-tests/blueprints/initializer-test.js
+++ b/node-tests/blueprints/initializer-test.js
@@ -6,7 +6,6 @@ const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
@@ -14,14 +13,11 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: initializer', function() {
+describe('Blueprint: initializer', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -32,8 +28,8 @@ describe('Blueprint: initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('initializer foo', function() {
- return emberGenerateDestroy(['initializer', 'foo'], _file => {
+ it('initializer foo', function () {
+ return emberGenerateDestroy(['initializer', 'foo'], (_file) => {
expect(_file('app/initializers/foo.js')).to.equal(fixture('initializer/initializer.js'));
expect(_file('tests/unit/initializers/foo-test.js')).to.contain(
@@ -42,8 +38,8 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo/bar', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar'], _file => {
+ it('initializer foo/bar', function () {
+ return emberGenerateDestroy(['initializer', 'foo/bar'], (_file) => {
expect(_file('app/initializers/foo/bar.js')).to.equal(
fixture('initializer/initializer-nested.js')
);
@@ -54,33 +50,33 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo --pod', function() {
- return emberGenerateDestroy(['initializer', 'foo', '--pod'], _file => {
+ it('initializer foo --pod', function () {
+ return emberGenerateDestroy(['initializer', 'foo', '--pod'], (_file) => {
expect(_file('app/initializers/foo.js')).to.equal(fixture('initializer/initializer.js'));
});
});
- it('initializer foo/bar --pod', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar', '--pod'], _file => {
+ it('initializer foo/bar --pod', function () {
+ return emberGenerateDestroy(['initializer', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/initializers/foo/bar.js')).to.equal(
fixture('initializer/initializer-nested.js')
);
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('initializer foo --pod', function() {
- return emberGenerateDestroy(['initializer', 'foo', '--pod'], _file => {
+ it('initializer foo --pod', function () {
+ return emberGenerateDestroy(['initializer', 'foo', '--pod'], (_file) => {
expect(_file('app/initializers/foo.js')).to.equal(fixture('initializer/initializer.js'));
});
});
- it('initializer foo/bar --pod', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar', '--pod'], _file => {
+ it('initializer foo/bar --pod', function () {
+ return emberGenerateDestroy(['initializer', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/initializers/foo/bar.js')).to.equal(
fixture('initializer/initializer-nested.js')
);
@@ -89,8 +85,8 @@ describe('Blueprint: initializer', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -101,8 +97,8 @@ describe('Blueprint: initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('initializer foo', function() {
- return emberGenerateDestroy(['initializer', 'foo'], _file => {
+ it('initializer foo', function () {
+ return emberGenerateDestroy(['initializer', 'foo'], (_file) => {
expect(_file('addon/initializers/foo.js')).to.equal(fixture('initializer/initializer.js'));
expect(_file('app/initializers/foo.js')).to.contain(
@@ -113,8 +109,8 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo/bar', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar'], _file => {
+ it('initializer foo/bar', function () {
+ return emberGenerateDestroy(['initializer', 'foo/bar'], (_file) => {
expect(_file('addon/initializers/foo/bar.js')).to.equal(
fixture('initializer/initializer-nested.js')
);
@@ -127,8 +123,8 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo --dummy', function() {
- return emberGenerateDestroy(['initializer', 'foo', '--dummy'], _file => {
+ it('initializer foo --dummy', function () {
+ return emberGenerateDestroy(['initializer', 'foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/initializers/foo.js')).to.equal(
fixture('initializer/initializer.js')
);
@@ -139,8 +135,8 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo/bar --dummy', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar', '--dummy'], _file => {
+ it('initializer foo/bar --dummy', function () {
+ return emberGenerateDestroy(['initializer', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/initializers/foo/bar.js')).to.equal(
fixture('initializer/initializer-nested.js')
);
@@ -152,8 +148,8 @@ describe('Blueprint: initializer', function() {
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -164,8 +160,8 @@ describe('Blueprint: initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('initializer foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['initializer', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('initializer foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['initializer', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/initializers/foo.js')).to.equal(
fixture('initializer/initializer.js')
);
@@ -178,152 +174,21 @@ describe('Blueprint: initializer', function() {
});
});
- it('initializer foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/initializers/foo/bar.js')).to.equal(
- fixture('initializer/initializer-nested.js')
- );
-
- expect(_file('lib/my-addon/app/initializers/foo/bar.js')).to.contain(
- "export { default, initialize } from 'my-addon/initializers/foo/bar';"
- );
-
- expect(_file('tests/unit/initializers/foo/bar-test.js')).to.exist;
- });
- });
- });
-
- describe('in app – module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('initializer foo', function() {
- return emberGenerateDestroy(['initializer', 'foo'], _file => {
- expect(_file('src/init/initializers/foo.js')).to.equal(
- fixture('initializer/initializer.js')
- );
-
- expect(_file('src/init/initializers/foo-test.js')).to.contain(
- "import { initialize } from 'my-app/init/initializers/foo';"
- );
- });
- });
-
- it('initializer foo/bar', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar'], _file => {
- expect(_file('src/init/initializers/foo/bar.js')).to.equal(
- fixture('initializer/initializer-nested.js')
- );
-
- expect(_file('src/init/initializers/foo/bar-test.js')).to.contain(
- "import { initialize } from 'my-app/init/initializers/foo/bar';"
- );
- });
- });
+ it('initializer foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(
+ ['initializer', 'foo/bar', '--in-repo-addon=my-addon'],
+ (_file) => {
+ expect(_file('lib/my-addon/addon/initializers/foo/bar.js')).to.equal(
+ fixture('initializer/initializer-nested.js')
+ );
- it('initializer foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['initializer', 'foo', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
+ expect(_file('lib/my-addon/app/initializers/foo/bar.js')).to.contain(
+ "export { default, initialize } from 'my-addon/initializers/foo/bar';"
+ );
- it('initializer foo/bar --pod', function() {
- return expectError(
- emberGenerateDestroy(['initializer', 'foo/bar', '--pod']),
- 'Pods arenʼt supported within a module unification app'
+ expect(_file('tests/unit/initializers/foo/bar-test.js')).to.exist;
+ }
);
});
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('initializer foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['initializer', 'foo', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
-
- it('initializer foo/bar --pod', function() {
- return expectError(
- emberGenerateDestroy(['initializer', 'foo/bar', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
- });
- });
-
- describe('in addon – module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('initializer foo', function() {
- return emberGenerateDestroy(['initializer', 'foo'], _file => {
- expect(_file('src/init/initializers/foo.js')).to.equal(
- fixture('initializer/initializer.js')
- );
-
- expect(_file('src/init/initializers/foo-test.js')).to.contain(
- "import { initialize } from 'dummy/init/initializers/foo';"
- );
- });
- });
-
- it('initializer foo/bar', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar'], _file => {
- expect(_file('src/init/initializers/foo/bar.js')).to.equal(
- fixture('initializer/initializer-nested.js')
- );
-
- expect(_file('src/init/initializers/foo/bar-test.js')).to.contain(
- "import { initialize } from 'dummy/init/initializers/foo/bar';"
- );
- });
- });
-
- it('initializer foo --dummy', function() {
- return emberGenerateDestroy(['initializer', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/initializers/foo.js')).to.equal(
- fixture('initializer/initializer.js')
- );
-
- expect(_file('src/init/initializers/foo.js')).to.not.exist;
- expect(_file('src/init/initializers/foo-test.js')).to.not.exist;
- });
- });
-
- it('initializer foo/bar --dummy', function() {
- return emberGenerateDestroy(['initializer', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/initializers/foo/bar.js')).to.equal(
- fixture('initializer/initializer-nested.js')
- );
-
- expect(_file('src/init/initializers/foo/bar.js')).to.not.exist;
- expect(_file('src/init/initializers/foo/bar-test.js')).to.not.exist;
- });
- });
});
});
diff --git a/node-tests/blueprints/instance-initializer-addon-test.js b/node-tests/blueprints/instance-initializer-addon-test.js
index 0c341ddb92b..d01ce48f8d8 100644
--- a/node-tests/blueprints/instance-initializer-addon-test.js
+++ b/node-tests/blueprints/instance-initializer-addon-test.js
@@ -8,24 +8,24 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-describe('Blueprint: instance-initializer-addon', function() {
+describe('Blueprint: instance-initializer-addon', function () {
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('instance-initializer-addon foo', function() {
- return emberGenerateDestroy(['instance-initializer-addon', 'foo'], _file => {
+ it('instance-initializer-addon foo', function () {
+ return emberGenerateDestroy(['instance-initializer-addon', 'foo'], (_file) => {
expect(_file('app/instance-initializers/foo.js')).to.contain(
"export { default, initialize } from 'my-addon/instance-initializers/foo';"
);
});
});
- it('instance-initializer-addon foo --pod', function() {
- return emberGenerateDestroy(['instance-initializer-addon', 'foo', '--pod'], _file => {
+ it('instance-initializer-addon foo --pod', function () {
+ return emberGenerateDestroy(['instance-initializer-addon', 'foo', '--pod'], (_file) => {
expect(_file('app/instance-initializers/foo.js')).to.contain(
"export { default, initialize } from 'my-addon/instance-initializers/foo';"
);
diff --git a/node-tests/blueprints/instance-initializer-test-test.js b/node-tests/blueprints/instance-initializer-test-test.js
index 2f489d86159..fa9a1205f67 100644
--- a/node-tests/blueprints/instance-initializer-test-test.js
+++ b/node-tests/blueprints/instance-initializer-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: instance-initializer-test', function() {
+describe('Blueprint: instance-initializer-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,8 +29,8 @@ describe('Blueprint: instance-initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
+ it('instance-initializer-test foo', function () {
+ return emberGenerateDestroy(['instance-initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/instance-initializers/foo-test.js')).to.equal(
fixture('instance-initializer-test/default.js')
);
@@ -41,8 +38,8 @@ describe('Blueprint: instance-initializer-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -50,8 +47,8 @@ describe('Blueprint: instance-initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
+ it('instance-initializer-test foo', function () {
+ return emberGenerateDestroy(['instance-initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/instance-initializers/foo-test.js')).to.equal(
fixture('instance-initializer-test/rfc232.js')
);
@@ -59,16 +56,16 @@ describe('Blueprint: instance-initializer-test', function() {
});
});
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
]);
});
- it('instance-initializer-test foo for mocha', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
+ it('instance-initializer-test foo for mocha', function () {
+ return emberGenerateDestroy(['instance-initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/instance-initializers/foo-test.js')).to.equal(
fixture('instance-initializer-test/mocha.js')
);
@@ -76,14 +73,17 @@ describe('Blueprint: instance-initializer-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('instance-initializer-test foo for mocha', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
+ it('instance-initializer-test foo for mocha', function () {
+ return emberGenerateDestroy(['instance-initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/instance-initializers/foo-test.js')).to.equal(
fixture('instance-initializer-test/mocha-rfc232.js')
);
@@ -92,13 +92,13 @@ describe('Blueprint: instance-initializer-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -106,8 +106,8 @@ describe('Blueprint: instance-initializer-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
+ it('instance-initializer-test foo', function () {
+ return emberGenerateDestroy(['instance-initializer-test', 'foo'], (_file) => {
expect(_file('tests/unit/instance-initializers/foo-test.js')).to.equal(
fixture('instance-initializer-test/dummy.js')
);
@@ -115,114 +115,4 @@ describe('Blueprint: instance-initializer-test', function() {
});
});
});
-
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/default.js')
- );
- });
- });
- });
-
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/rfc232.js')
- );
- });
- });
- });
-
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- });
-
- it('instance-initializer-test foo for mocha', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/mocha.js')
- );
- });
- });
- });
-
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
- generateFakePackageManifest('ember-mocha', '0.14.0');
- });
-
- it('instance-initializer-test foo for mocha', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/mocha-rfc232.js')
- );
- });
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('instance-initializer-test foo', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/dummy.js')
- );
- });
- });
-
- it('instance-initializer-test foo --dummy', function() {
- return emberGenerateDestroy(['instance-initializer-test', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/instance-initializers/foo-test.js')).to.equal(
- fixture('instance-initializer-test/module-unification/dummy.js')
- );
- });
- });
- });
- });
});
diff --git a/node-tests/blueprints/instance-initializer-test.js b/node-tests/blueprints/instance-initializer-test.js
index fd785826542..7783a5ddee3 100644
--- a/node-tests/blueprints/instance-initializer-test.js
+++ b/node-tests/blueprints/instance-initializer-test.js
@@ -6,7 +6,6 @@ const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
@@ -14,14 +13,11 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: instance-initializer', function() {
+describe('Blueprint: instance-initializer', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -32,8 +28,8 @@ describe('Blueprint: instance-initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('instance-initializer foo', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo'], _file => {
+ it('instance-initializer foo', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo'], (_file) => {
expect(_file('app/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
@@ -44,8 +40,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- it('instance-initializer foo/bar', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar'], _file => {
+ it('instance-initializer foo/bar', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo/bar'], (_file) => {
expect(_file('app/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer-nested.js')
);
@@ -56,37 +52,37 @@ describe('Blueprint: instance-initializer', function() {
});
});
- it('instance-initializer foo --pod', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo', '--pod'], _file => {
+ it('instance-initializer foo --pod', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo', '--pod'], (_file) => {
expect(_file('app/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
});
});
- it('instance-initializer foo/bar --pod', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod'], _file => {
+ it('instance-initializer foo/bar --pod', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer-nested.js')
);
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('instance-initializer foo --pod', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo', '--pod'], _file => {
+ it('instance-initializer foo --pod', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo', '--pod'], (_file) => {
expect(_file('app/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
});
});
- it('instance-initializer foo/bar --pod', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod'], _file => {
+ it('instance-initializer foo/bar --pod', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer-nested.js')
);
@@ -95,8 +91,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -107,8 +103,8 @@ describe('Blueprint: instance-initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('instance-initializer foo', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo'], _file => {
+ it('instance-initializer foo', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo'], (_file) => {
expect(_file('addon/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
@@ -121,8 +117,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- it('instance-initializer foo/bar', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar'], _file => {
+ it('instance-initializer foo/bar', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo/bar'], (_file) => {
expect(_file('addon/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer-nested.js')
);
@@ -135,8 +131,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- it('instance-initializer foo --dummy', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo', '--dummy'], _file => {
+ it('instance-initializer foo --dummy', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
@@ -147,8 +143,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- it('instance-initializer foo/bar --dummy', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--dummy'], _file => {
+ it('instance-initializer foo/bar --dummy', function () {
+ return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer-nested.js')
);
@@ -160,8 +156,8 @@ describe('Blueprint: instance-initializer', function() {
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -172,10 +168,10 @@ describe('Blueprint: instance-initializer', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('instance-initializer foo --in-repo-addon=my-addon', function() {
+ it('instance-initializer foo --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
['instance-initializer', 'foo', '--in-repo-addon=my-addon'],
- _file => {
+ (_file) => {
expect(_file('lib/my-addon/addon/instance-initializers/foo.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
@@ -189,10 +185,10 @@ describe('Blueprint: instance-initializer', function() {
);
});
- it('instance-initializer foo/bar --in-repo-addon=my-addon', function() {
+ it('instance-initializer foo/bar --in-repo-addon=my-addon', function () {
return emberGenerateDestroy(
['instance-initializer', 'foo/bar', '--in-repo-addon=my-addon'],
- _file => {
+ (_file) => {
expect(_file('lib/my-addon/addon/instance-initializers/foo/bar.js')).to.equal(
fixture('instance-initializer/instance-initializer.js')
);
@@ -206,136 +202,4 @@ describe('Blueprint: instance-initializer', function() {
);
});
});
-
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('instance-initializer foo', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo.js')).to.equal(
- fixture('instance-initializer/instance-initializer.js')
- );
-
- expect(_file('src/init/instance-initializers/foo-test.js')).to.contain(
- "import { initialize } from 'my-app/init/instance-initializers/foo';"
- );
- });
- });
-
- it('instance-initializer foo/bar', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar'], _file => {
- expect(_file('src/init/instance-initializers/foo/bar.js')).to.equal(
- fixture('instance-initializer/instance-initializer-nested.js')
- );
-
- expect(_file('src/init/instance-initializers/foo/bar-test.js')).to.contain(
- "import { initialize } from 'my-app/init/instance-initializers/foo/bar';"
- );
- });
- });
-
- it('instance-initializer foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['instance-initializer', 'foo', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
-
- it('instance-initializer foo/bar --pod', function() {
- return expectError(
- emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('instance-initializer foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['instance-initializer', 'foo', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
-
- it('instance-initializer foo/bar --pod', function() {
- return expectError(
- emberGenerateDestroy(['instance-initializer', 'foo/bar', '--pod']),
- 'Pods arenʼt supported within a module unification app'
- );
- });
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('instance-initializer foo', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo'], _file => {
- expect(_file('src/init/instance-initializers/foo.js')).to.equal(
- fixture('instance-initializer/instance-initializer.js')
- );
-
- expect(_file('tests/unit/instance-initializers/foo-test.js'));
- });
- });
-
- it('instance-initializer foo/bar', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar'], _file => {
- expect(_file('src/init/instance-initializers/foo/bar.js')).to.equal(
- fixture('instance-initializer/instance-initializer-nested.js')
- );
-
- expect(_file('src/init/instance-initializers/foo/bar-test.js'));
- });
- });
-
- it('instance-initializer foo --dummy', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/instance-initializers/foo.js')).to.equal(
- fixture('instance-initializer/instance-initializer.js')
- );
-
- expect(_file('src/init/instance-initializers/foo.js')).to.not.exist;
-
- expect(_file('src/init/instance-initializers/foo-test.js')).to.not.exist;
- });
- });
-
- it('instance-initializer foo/bar --dummy', function() {
- return emberGenerateDestroy(['instance-initializer', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/init/instance-initializers/foo/bar.js')).to.equal(
- fixture('instance-initializer/instance-initializer-nested.js')
- );
-
- expect(_file('src/init/instance-initializers/foo/bar.js')).to.not.exist;
-
- expect(_file('src/init/instance-initializers/foo/bar-test.js')).to.not.exist;
- });
- });
- });
});
diff --git a/node-tests/blueprints/mixin-test-test.js b/node-tests/blueprints/mixin-test-test.js
index 7ffed38870d..65f15a35bc3 100644
--- a/node-tests/blueprints/mixin-test-test.js
+++ b/node-tests/blueprints/mixin-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: mixin-test', function() {
+describe('Blueprint: mixin-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,30 +29,30 @@ describe('Blueprint: mixin-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
+ it('mixin-test foo', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(fixture('mixin-test/default.js'));
});
});
});
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
]);
});
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
+ it('mixin-test foo', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(fixture('mixin-test/mocha.js'));
});
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -63,21 +60,24 @@ describe('Blueprint: mixin-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
+ it('mixin-test foo', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(fixture('mixin-test/rfc232.js'));
});
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
+ it('mixin-test foo', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(
fixture('mixin-test/mocha-rfc232.js')
);
@@ -86,63 +86,8 @@ describe('Blueprint: mixin-test', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
- expect(_file('src/mixins/foo-test.js')).to.equal(fixture('mixin-test/default.js'));
- });
- });
- });
-
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- });
-
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
- expect(_file('src/mixins/foo-test.js')).to.equal(fixture('mixin-test/mocha.js'));
- });
- });
- });
-
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
- expect(_file('src/mixins/foo-test.js')).to.equal(fixture('mixin-test/rfc232.js'));
- });
- });
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' }).then(() =>
modifyPackages([
{ name: 'ember-qunit', delete: true },
@@ -151,34 +96,15 @@ describe('Blueprint: mixin-test', function() {
);
});
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
+ it('mixin-test foo', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(fixture('mixin-test/addon.js'));
});
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' }).then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- );
- });
-
- it('mixin-test foo', function() {
- return emberGenerateDestroy(['mixin-test', 'foo'], _file => {
- expect(_file('src/mixins/foo-test.js')).to.equal(fixture('mixin-test/addon.js'));
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' }).then(() =>
modifyPackages([
{ name: 'ember-qunit', delete: true },
@@ -187,8 +113,8 @@ describe('Blueprint: mixin-test', function() {
);
});
- it('mixin-test foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['mixin-test', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('mixin-test foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['mixin-test', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('tests/unit/mixins/foo-test.js')).to.equal(fixture('mixin-test/addon.js'));
});
});
diff --git a/node-tests/blueprints/mixin-test.js b/node-tests/blueprints/mixin-test.js
index 0d70a37cc37..4f8e1da2621 100644
--- a/node-tests/blueprints/mixin-test.js
+++ b/node-tests/blueprints/mixin-test.js
@@ -5,28 +5,23 @@ const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
-const expectError = require('../helpers/expect-error');
-const EOL = require('os').EOL;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: mixin', function() {
+describe('Blueprint: mixin', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- it('mixin foo', function() {
- return emberGenerateDestroy(['mixin', 'foo'], _file => {
+ it('mixin foo', function () {
+ return emberGenerateDestroy(['mixin', 'foo'], (_file) => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -34,14 +29,14 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo.js', function() {
- return emberGenerateDestroy(['mixin', 'foo.js'], _file => {
+ it('mixin foo.js', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js'], (_file) => {
expect(_file('app/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/unit/mixins/foo.js-test.js')).to.not.exist;
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -49,11 +44,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
+ it('mixin foo/bar', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar'], (_file) => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
@@ -61,19 +56,19 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar/baz', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
+ it('mixin foo/bar/baz', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar/baz'], (_file) => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
);
});
});
- it('mixin foo --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => {
+ it('mixin foo --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo', '--pod'], (_file) => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -81,14 +76,14 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo.js --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo.js', '--pod'], _file => {
+ it('mixin foo.js --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js', '--pod'], (_file) => {
expect(_file('app/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/unit/mixins/foo.js-test.js')).to.not.exist;
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -96,11 +91,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => {
+ it('mixin foo/bar --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
@@ -108,24 +103,24 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar/baz --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--pod'], _file => {
+ it('mixin foo/bar/baz --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--pod'], (_file) => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
);
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('mixin foo --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo', '--pod'], _file => {
+ it('mixin foo --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo', '--pod'], (_file) => {
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -133,14 +128,14 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo.js --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo.js', '--pod'], _file => {
+ it('mixin foo.js --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js', '--pod'], (_file) => {
expect(_file('app/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/unit/mixins/foo.js-test.js')).to.not.exist;
expect(_file('app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-app/mixins/foo';"
@@ -148,11 +143,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar --pod', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], _file => {
+ it('mixin foo/bar --pod', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-app/mixins/foo/bar';"
@@ -162,82 +157,16 @@ describe('Blueprint: mixin', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- it('mixin foo', function() {
- return emberGenerateDestroy(['mixin', 'foo'], _file => {
- expect(_file('src/mixins/foo.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo-test.js')).to.contain(
- "import FooMixin from 'my-app/mixins/foo';"
- );
- });
- });
-
- it('mixin foo.js', function() {
- return emberGenerateDestroy(['mixin', 'foo'], _file => {
- expect(_file('src/mixins/foo.js.js')).to.not.exist;
- expect(_file('src/mixins/foo.js-test.js')).to.not.exist;
-
- expect(_file('src/mixins/foo.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo-test.js')).to.contain(
- "import FooMixin from 'my-app/mixins/foo';"
- );
- });
- });
-
- it('mixin foo/bar', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
- expect(_file('src/mixins/foo/bar.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo/bar-test.js')).to.contain(
- "import FooBarMixin from 'my-app/mixins/foo/bar';"
- );
- });
- });
-
- it('mixin foo/bar/baz', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
- expect(_file('src/mixins/foo/bar/baz.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain(
- "import FooBarBazMixin from 'my-app/mixins/foo/bar/baz';"
- );
- });
- });
-
- it('mixin foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['service', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('mixin foo', function() {
- return emberGenerateDestroy(['mixin', 'foo'], _file => {
+ it('mixin foo', function () {
+ return emberGenerateDestroy(['mixin', 'foo'], (_file) => {
expect(_file('addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
@@ -247,14 +176,14 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo.js', function() {
- return emberGenerateDestroy(['mixin', 'foo.js'], _file => {
+ it('mixin foo.js', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js'], (_file) => {
expect(_file('addon/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/unit/mixins/foo.js-test.js')).to.not.exist;
expect(_file('addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
@@ -264,11 +193,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
+ it('mixin foo/bar', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar'], (_file) => {
expect(_file('addon/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-addon/mixins/foo/bar';"
@@ -278,11 +207,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar/baz', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
+ it('mixin foo/bar/baz', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar/baz'], (_file) => {
expect(_file('addon/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
@@ -292,120 +221,39 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar/baz --dummy', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => {
+ it('mixin foo/bar/baz --dummy', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/mixins/foo/bar/baz.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('addon/mixins/foo/bar/baz.js')).to.not.exist;
});
});
- it('mixin foo.js --dummy', function() {
- return emberGenerateDestroy(['mixin', 'foo.js', '--dummy'], _file => {
+ it('mixin foo.js --dummy', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/dummy/app/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('addon/mixins/foo.js')).to.not.exist;
});
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- it('mixin foo', function() {
- return emberGenerateDestroy(['mixin', 'foo'], _file => {
- expect(_file('src/mixins/foo.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo-test.js')).to.contain(
- "import FooMixin from 'my-addon/mixins/foo';"
- );
- });
- });
-
- it('mixin foo.js', function() {
- return emberGenerateDestroy(['mixin', 'foo.js'], _file => {
- expect(_file('src/mixins/foo.js.js')).to.not.exist;
- expect(_file('src/mixins/foo.js-test.js')).to.not.exist;
-
- expect(_file('src/mixins/foo.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo-test.js')).to.contain(
- "import FooMixin from 'my-addon/mixins/foo';"
- );
- });
- });
-
- it('mixin foo/bar', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar'], _file => {
- expect(_file('src/mixins/foo/bar.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo/bar-test.js')).to.contain(
- "import FooBarMixin from 'my-addon/mixins/foo/bar';"
- );
- });
- });
-
- it('mixin foo/bar/baz', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz'], _file => {
- expect(_file('src/mixins/foo/bar/baz.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo/bar/baz-test.js')).to.contain(
- "import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
- );
- });
- });
-
- it('mixin foo/bar/baz --dummy', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--dummy'], _file => {
- expect(_file('tests/dummy/src/mixins/foo/bar/baz.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo/bar/baz.js')).to.not.exist;
- });
- });
-
- it('mixin foo.js --dummy', function() {
- return emberGenerateDestroy(['mixin', 'foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/mixins/foo.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/src/mixins/foo.js'))
- .to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
-
- expect(_file('src/mixins/foo.js')).to.not.exist;
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' });
});
- it('mixin foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['mixin', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('mixin foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['mixin', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
@@ -413,14 +261,14 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['mixin', 'foo.js', '--in-repo-addon=my-addon'], _file => {
+ it('mixin foo.js --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['mixin', 'foo.js', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/mixins/foo.js.js')).to.not.exist;
expect(_file('tests/unit/mixins/foo.js-test.js')).to.not.exist;
expect(_file('lib/my-addon/addon/mixins/foo.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo-test.js')).to.contain(
"import FooMixin from 'my-addon/mixins/foo';"
@@ -428,11 +276,11 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
+ it('mixin foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/mixins/foo/bar.js'))
.to.contain("import Mixin from '@ember/object/mixin';")
- .to.contain(`export default Mixin.create({${EOL}});`);
+ .to.contain(`export default Mixin.create({});`);
expect(_file('tests/unit/mixins/foo/bar-test.js')).to.contain(
"import FooBarMixin from 'my-addon/mixins/foo/bar';"
@@ -440,8 +288,8 @@ describe('Blueprint: mixin', function() {
});
});
- it('mixin foo/bar/baz --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--in-repo-addon=my-addon'], _file => {
+ it('mixin foo/bar/baz --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['mixin', 'foo/bar/baz', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('tests/unit/mixins/foo/bar/baz-test.js')).to.contain(
"import FooBarBazMixin from 'my-addon/mixins/foo/bar/baz';"
);
diff --git a/node-tests/blueprints/route-addon-test.js b/node-tests/blueprints/route-addon-test.js
index 3086d38e797..f0a9b82ac97 100644
--- a/node-tests/blueprints/route-addon-test.js
+++ b/node-tests/blueprints/route-addon-test.js
@@ -8,16 +8,16 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-describe('Blueprint: route-addon', function() {
+describe('Blueprint: route-addon', function () {
setupTestHooks(this);
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('route-addon foo', function() {
- return emberGenerateDestroy(['route-addon', 'foo'], _file => {
+ it('route-addon foo', function () {
+ return emberGenerateDestroy(['route-addon', 'foo'], (_file) => {
expect(_file('app/routes/foo.js')).to.contain(
"export { default } from 'my-addon/routes/foo';"
);
diff --git a/node-tests/blueprints/route-test-test.js b/node-tests/blueprints/route-test-test.js
index 081ceeb5c08..ef8eade5e72 100644
--- a/node-tests/blueprints/route-test-test.js
+++ b/node-tests/blueprints/route-test-test.js
@@ -12,16 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-describe('Blueprint: route-test', function() {
+describe('Blueprint: route-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -29,15 +29,15 @@ describe('Blueprint: route-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
});
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -45,15 +45,15 @@ describe('Blueprint: route-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/rfc232.js'));
});
});
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.11.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -61,15 +61,15 @@ describe('Blueprint: route-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.11.0');
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/mocha.js'));
});
});
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.12.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -77,8 +77,8 @@ describe('Blueprint: route-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.12.0');
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
expect(_file('tests/unit/routes/foo-test.js')).to.equal(
fixture('route-test/mocha-0.12.js')
);
@@ -86,14 +86,17 @@ describe('Blueprint: route-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
expect(_file('tests/unit/routes/foo-test.js')).to.equal(
fixture('route-test/mocha-rfc232.js')
);
@@ -102,21 +105,52 @@ describe('Blueprint: route-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
+ describe('in addon', function () {
+ beforeEach(function () {
+ return emberNew({ target: 'addon' });
+ });
+
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-cli-qunit', dev: true },
+ ]);
+ generateFakePackageManifest('ember-cli-qunit', '4.1.0');
+ });
+
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
+ });
+ });
});
- it('route-test foo', function() {
- return emberGenerateDestroy(['route-test', 'foo'], _file => {
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
+ describe('with ember-qunit (default)', function () {
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/routes/foo-test.js')).to.equal(
+ fixture('route-test/rfc232-addon.js')
+ );
+ });
+ });
+ });
+
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
+ generateFakePackageManifest('ember-mocha', '0.16.2');
+ });
+
+ it('route-test foo', function () {
+ return emberGenerateDestroy(['route-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/routes/foo-test.js')).to.equal(
+ fixture('route-test/mocha-rfc232-addon.js')
+ );
+ });
});
});
});
diff --git a/node-tests/blueprints/route-test.js b/node-tests/blueprints/route-test.js
index 2d9f3bc010d..40cf0121364 100644
--- a/node-tests/blueprints/route-test.js
+++ b/node-tests/blueprints/route-test.js
@@ -9,7 +9,6 @@ const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
const file = chai.file;
@@ -19,29 +18,31 @@ const generateFakePackageManifest = require('../helpers/generate-fake-package-ma
const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const enableOctane = setupTestEnvironment.enableOctane;
-describe('Blueprint: route', function() {
+describe('Blueprint: route', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
+ { name: 'ember-page-title', dev: true },
])
)
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
+ it('route foo', function () {
+ return emberGenerateDestroy(['route', 'foo'], (_file) => {
expect(_file('app/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/templates/foo.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
@@ -51,15 +52,15 @@ describe('Blueprint: route', function() {
});
});
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo.js'], _file => {
+ it('route foo.js', function () {
+ return emberGenerateDestroy(['route', 'foo.js'], (_file) => {
expect(_file('app/routes/foo.js.js')).to.not.exist;
expect(_file('app/templates/foo.js.hbs')).to.not.exist;
expect(_file('tests/unit/routes/foo.js-test.js')).to.not.exist;
expect(_file('app/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/templates/foo.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
@@ -70,8 +71,8 @@ describe('Blueprint: route', function() {
});
});
- it('route foo --skip-router', function() {
- return emberGenerateDestroy(['route', 'foo', '--skip-router'], _file => {
+ it('route foo --skip-router', function () {
+ return emberGenerateDestroy(['route', 'foo', '--skip-router'], (_file) => {
expect(_file('app/routes/foo.js')).to.exist;
expect(_file('app/templates/foo.hbs')).to.exist;
expect(_file('tests/unit/routes/foo-test.js')).to.exist;
@@ -81,11 +82,11 @@ describe('Blueprint: route', function() {
});
});
- it('route foo --path=:foo_id/show', function() {
- return emberGenerateDestroy(['route', 'foo', '--path=:foo_id/show'], _file => {
- expect(_file('app/routes/foo.js')).to.equal(fixture('route/route.js'));
+ it('route foo --path=:foo_id/show', function () {
+ return emberGenerateDestroy(['route', 'foo', '--path=:foo_id/show'], (_file) => {
+ expect(_file('app/routes/foo.js')).to.equal(fixture('route/route-with-dynamic-segment.js'));
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/templates/foo.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
@@ -100,11 +101,11 @@ describe('Blueprint: route', function() {
});
});
- it('route parent/child --reset-namespace', function() {
- return emberGenerateDestroy(['route', 'parent/child', '--reset-namespace'], _file => {
+ it('route parent/child --reset-namespace', function () {
+ return emberGenerateDestroy(['route', 'parent/child', '--reset-namespace'], (_file) => {
expect(_file('app/routes/child.js')).to.equal(fixture('route/route-child.js'));
- expect(_file('app/templates/child.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/templates/child.hbs')).to.equal('{{page-title "Child"}}\n{{outlet}}');
expect(_file('tests/unit/routes/child-test.js')).to.equal(
fixture('route-test/default-child.js')
@@ -118,13 +119,13 @@ describe('Blueprint: route', function() {
});
});
- it('route parent/child --reset-namespace --pod', function() {
+ it('route parent/child --reset-namespace --pod', function () {
return emberGenerateDestroy(
['route', 'parent/child', '--reset-namespace', '--pod'],
- _file => {
+ (_file) => {
expect(_file('app/child/route.js')).to.equal(fixture('route/route-child.js'));
- expect(_file('app/child/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/child/template.hbs')).to.equal('{{page-title "Child"}}\n{{outlet}}');
expect(_file('tests/unit/child/route-test.js')).to.equal(
fixture('route-test/default-child.js')
@@ -139,8 +140,8 @@ describe('Blueprint: route', function() {
);
});
- it('route index', function() {
- return emberGenerateDestroy(['route', 'index'], _file => {
+ it('route index', function () {
+ return emberGenerateDestroy(['route', 'index'], (_file) => {
expect(_file('app/routes/index.js')).to.exist;
expect(_file('app/templates/index.hbs')).to.exist;
expect(_file('tests/unit/routes/index-test.js')).to.exist;
@@ -150,15 +151,15 @@ describe('Blueprint: route', function() {
});
});
- it('route application', function() {
+ it('route application', function () {
fs.removeSync('app/templates/application.hbs');
return emberGenerate(['route', 'application']).then(() => {
expect(file('app/router.js')).to.not.contain("this.route('application')");
});
});
- it('route basic', function() {
- return emberGenerateDestroy(['route', 'basic'], _file => {
+ it('route basic', function () {
+ return emberGenerateDestroy(['route', 'basic'], (_file) => {
expect(_file('app/routes/basic.js')).to.exist;
expect(file('app/router.js')).to.not.contain("this.route('basic')");
}).then(() => {
@@ -166,40 +167,44 @@ describe('Blueprint: route', function() {
});
});
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
+ it('route foo --pod', function () {
+ return emberGenerateDestroy(['route', 'foo', '--pod'], (_file) => {
expect(_file('app/foo.js/route.js')).to.not.exist;
expect(_file('app/foo.js/template.hbs')).to.not.exist;
expect(_file('tests/unit/foo.js/route-test.js')).to.not.exist;
expect(_file('app/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
expect(file('app/router.js')).to.contain("this.route('foo')");
- expect(file('app/router.js')).to.not.contain("this.route('foo.js')");
}).then(() => {
expect(file('app/router.js')).to.not.contain("this.route('foo')");
});
});
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--pod'], _file => {
+ it('route foo.js --pod', function () {
+ return emberGenerateDestroy(['route', 'foo.js', '--pod'], (_file) => {
+ expect(_file('app/foo.js/route.js')).to.not.exist;
+ expect(_file('app/foo.js/template.hbs')).to.not.exist;
+ expect(_file('tests/unit/foo.js/route-test.js')).to.not.exist;
+
expect(_file('app/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
expect(file('app/router.js')).to.contain("this.route('foo')");
+ expect(file('app/router.js')).to.not.contain("this.route('foo.js')");
}).then(() => {
expect(file('app/router.js')).to.not.contain("this.route('foo')");
});
});
- it('route foo --pod with --path', function() {
+ it('route foo --pod with --path', function () {
return emberGenerate(['route', 'foo', '--pod', '--path=:foo_id/show'])
.then(() =>
expect(file('app/router.js'))
@@ -216,36 +221,36 @@ describe('Blueprint: route', function() {
);
});
- it('route index --pod', function() {
+ it('route index --pod', function () {
return emberGenerate(['route', 'index', '--pod']).then(() =>
expect(file('app/router.js')).to.not.contain("this.route('index')")
);
});
- it('route application --pod', function() {
+ it('route application --pod', function () {
return emberGenerate(['route', 'application', '--pod'])
.then(() => expect(file('app/application/route.js')).to.exist)
.then(() => expect(file('app/application/template.hbs')).to.exist)
.then(() => expect(file('app/router.js')).to.not.contain("this.route('application')"));
});
- it('route basic --pod', function() {
- return emberGenerateDestroy(['route', 'basic', '--pod'], _file => {
+ it('route basic --pod', function () {
+ return emberGenerateDestroy(['route', 'basic', '--pod'], (_file) => {
expect(_file('app/basic/route.js')).to.exist;
expect(file('app/router.js')).to.not.contain("this.route('index')");
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
+ it('route foo --pod', function () {
+ return emberGenerateDestroy(['route', 'foo', '--pod'], (_file) => {
expect(_file('app/pods/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/pods/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/pods/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/pods/foo/route-test.js')).to.equal(
fixture('route-test/default.js')
@@ -257,15 +262,15 @@ describe('Blueprint: route', function() {
});
});
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
+ it('route foo.js --pod', function () {
+ return emberGenerateDestroy(['route', 'foo.js', '--pod'], (_file) => {
expect(_file('app/pods/foo.js/route.js')).to.not.exist;
expect(_file('app/pods/foo.js/template.hbs')).to.not.exist;
expect(_file('tests/unit/pods/foo.js/route-test.js')).to.not.exist;
expect(_file('app/pods/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('app/pods/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('app/pods/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('tests/unit/pods/foo/route-test.js')).to.equal(
fixture('route-test/default.js')
@@ -277,26 +282,73 @@ describe('Blueprint: route', function() {
expect(file('app/router.js')).to.not.contain("this.route('foo')");
});
});
+
+ describe('ember-page-title is not installed', function () {
+ beforeEach(function () {
+ return modifyPackages([{ name: 'ember-page-title', delete: true }]);
+ });
+
+ it('route foo', function () {
+ return emberGenerateDestroy(['route', 'foo'], (_file) => {
+ expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ });
+ });
+
+ it('route foo/bar', function () {
+ return emberGenerateDestroy(['route', 'foo/bar'], (_file) => {
+ expect(_file('app/templates/foo/bar.hbs')).to.equal('{{outlet}}');
+ });
+ });
+ });
+ });
+
+ it('using a `router.ts` file', async function () {
+ fs.moveSync('app/router.js', 'app/router.ts');
+
+ await emberGenerate(['route', 'foo']);
+ expect(file('app/router.ts')).to.contain("this.route('foo')");
+
+ await emberDestroy(['route', 'foo']);
+ expect(file('app/router.ts')).to.not.contain("this.route('foo')");
+ });
+
+ it('throws a helpful error if a router file could not be found', async function () {
+ fs.removeSync('app/router.js');
+
+ await expect(emberGenerate(['route', 'foo'])).to.be.rejectedWith(
+ 'Could not find a router file. Please make sure your project has a `router.js` or `router.ts` file.'
+ );
+ });
+
+ it('throws a helpful error if both a `router.ts` and `router.js` file are found', async function () {
+ fs.copySync('app/router.js', 'app/router.ts');
+
+ await expect(emberGenerate(['route', 'foo'])).to.be.rejectedWith(
+ 'Found both a `router.js` and `router.ts` file. Please make sure your project only has one or the other.'
+ );
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
+ { name: 'ember-page-title', dev: true },
])
)
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
+ it('route foo', function () {
+ return emberGenerateDestroy(['route', 'foo'], (_file) => {
expect(_file('addon/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('addon/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('addon/templates/foo.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('app/routes/foo.js')).to.contain(
"export { default } from 'my-addon/routes/foo';"
@@ -314,8 +366,8 @@ describe('Blueprint: route', function() {
});
});
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo.js'], _file => {
+ it('route foo.js', function () {
+ return emberGenerateDestroy(['route', 'foo.js'], (_file) => {
expect(_file('addon/routes/foo.js.js')).to.not.exist;
expect(_file('addon/templates/foo.js.hbs')).to.not.exist;
expect(_file('app/routes/foo.js.js')).to.not.exist;
@@ -324,7 +376,7 @@ describe('Blueprint: route', function() {
expect(_file('addon/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('addon/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('addon/templates/foo.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('app/routes/foo.js')).to.contain(
"export { default } from 'my-addon/routes/foo';"
@@ -343,11 +395,11 @@ describe('Blueprint: route', function() {
});
});
- it('route foo/bar', function() {
- return emberGenerateDestroy(['route', 'foo/bar'], _file => {
+ it('route foo/bar', function () {
+ return emberGenerateDestroy(['route', 'foo/bar'], (_file) => {
expect(_file('addon/routes/foo/bar.js')).to.equal(fixture('route/route-nested.js'));
- expect(_file('addon/templates/foo/bar.hbs')).to.equal('{{outlet}}');
+ expect(_file('addon/templates/foo/bar.hbs')).to.equal('{{page-title "Bar"}}\n{{outlet}}');
expect(_file('app/routes/foo/bar.js')).to.contain(
"export { default } from 'my-addon/routes/foo/bar';"
@@ -367,11 +419,13 @@ describe('Blueprint: route', function() {
});
});
- it('route foo --dummy', function() {
- return emberGenerateDestroy(['route', 'foo', '--dummy'], _file => {
+ it('route foo --dummy', function () {
+ return emberGenerateDestroy(['route', 'foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal(
+ '{{page-title "Foo"}}\n{{outlet}}'
+ );
expect(_file('app/routes/foo.js')).to.not.exist;
expect(_file('app/templates/foo.hbs')).to.not.exist;
@@ -383,14 +437,16 @@ describe('Blueprint: route', function() {
});
});
- it('route foo.js --dummy', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--dummy'], _file => {
+ it('route foo.js --dummy', function () {
+ return emberGenerateDestroy(['route', 'foo.js', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/routes/foo.js.js')).to.not.exist;
expect(_file('tests/dummy/app/templates/foo.js.hbs')).to.not.exist;
expect(_file('tests/dummy/app/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal(
+ '{{page-title "Foo"}}\n{{outlet}}'
+ );
expect(_file('app/routes/foo.js')).to.not.exist;
expect(_file('app/templates/foo.hbs')).to.not.exist;
@@ -403,13 +459,15 @@ describe('Blueprint: route', function() {
});
});
- it('route foo/bar --dummy', function() {
- return emberGenerateDestroy(['route', 'foo/bar', '--dummy'], _file => {
+ it('route foo/bar --dummy', function () {
+ return emberGenerateDestroy(['route', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/routes/foo/bar.js')).to.equal(
fixture('route/route-nested.js')
);
- expect(_file('tests/dummy/app/templates/foo/bar.hbs')).to.equal('{{outlet}}');
+ expect(_file('tests/dummy/app/templates/foo/bar.hbs')).to.equal(
+ '{{page-title "Bar"}}\n{{outlet}}'
+ );
expect(_file('app/routes/foo/bar.js')).to.not.exist;
expect(_file('app/templates/foo/bar.hbs')).to.not.exist;
@@ -423,11 +481,11 @@ describe('Blueprint: route', function() {
});
});
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
+ it('route foo --pod', function () {
+ return emberGenerateDestroy(['route', 'foo', '--pod'], (_file) => {
expect(_file('addon/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('addon/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('addon/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('app/foo/route.js')).to.contain(
"export { default } from 'my-addon/foo/route';"
@@ -441,8 +499,8 @@ describe('Blueprint: route', function() {
});
});
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--pod'], _file => {
+ it('route foo.js --pod', function () {
+ return emberGenerateDestroy(['route', 'foo.js', '--pod'], (_file) => {
expect(_file('addon/foo.js/route.js')).to.not.exist;
expect(_file('addon/foo.js/template.hbs')).to.not.exist;
expect(_file('app/foo.js/route.js')).to.not.exist;
@@ -451,7 +509,7 @@ describe('Blueprint: route', function() {
expect(_file('addon/foo/route.js')).to.equal(fixture('route/route.js'));
- expect(_file('addon/foo/template.hbs')).to.equal('{{outlet}}');
+ expect(_file('addon/foo/template.hbs')).to.equal('{{page-title "Foo"}}\n{{outlet}}');
expect(_file('app/foo/route.js')).to.contain(
"export { default } from 'my-addon/foo/route';"
@@ -464,835 +522,152 @@ describe('Blueprint: route', function() {
expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
});
});
- });
-
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('src/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo.js'], _file => {
- expect(_file('src/ui/routes/foo.js/route.js')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/route-test.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('src/router.js')).to.contain("this.route('foo')");
- expect(file('src/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo --skip-router', function() {
- return emberGenerateDestroy(['route', 'foo', '--skip-router'], _file => {
- expect(_file('src/ui/routes/foo/route.js')).to.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.exist;
- expect(_file('src/ui/routes/foo/route-test.js')).to.exist;
- expect(file('src/router.js')).to.not.contain("this.route('foo')");
- }).then(() => {
- expect(file('src/router.js')).to.not.contain("this.route('foo')");
- });
- });
- it('route foo --path=:foo_id/show', function() {
- return emberGenerateDestroy(['route', 'foo', '--path=:foo_id/show'], _file => {
- expect(_file('src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('src/router.js'))
- .to.contain("this.route('foo', {")
- .to.contain("path: ':foo_id/show'")
- .to.contain('});');
- }).then(() => {
- expect(file('src/router.js'))
- .to.not.contain("this.route('foo'")
- .to.not.contain("path: ':foo_id/show'");
+ describe('ember-page-title is not installed', function () {
+ beforeEach(function () {
+ return modifyPackages([{ name: 'ember-page-title', delete: true }]);
});
- });
-
- it('route parent/child --reset-namespace', function() {
- return emberGenerateDestroy(['route', 'parent/child', '--reset-namespace'], _file => {
- expect(_file('src/ui/routes/parent/child/route.js')).to.equal(
- fixture('route/route-child.js')
- );
-
- expect(_file('src/ui/routes/parent/child/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/parent/child/route-test.js')).to.equal(
- fixture('route-test/default-child.js')
- );
- expect(file('src/router.js'))
- .to.contain("this.route('parent', {")
- .to.contain("this.route('child', {")
- .to.contain('resetNamespace: true')
- .to.contain('});');
+ it('route foo', function () {
+ return emberGenerateDestroy(['route', 'foo'], (_file) => {
+ expect(_file('addon/templates/foo.hbs')).to.equal('{{outlet}}');
+ });
});
- });
-
- it('route parent/child --reset-namespace --pod', function() {
- return expectError(
- emberGenerateDestroy(['route', 'parent/child', '--reset-namespace', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- it('route index', function() {
- return emberGenerateDestroy(['route', 'index'], _file => {
- expect(_file('src/ui/routes/index/route.js')).to.exist;
- expect(_file('src/ui/routes/index/template.hbs')).to.exist;
- expect(_file('src/ui/routes/index/route-test.js')).to.exist;
- expect(file('src/router.js')).to.not.contain("this.route('index')");
- }).then(() => {
- expect(file('src/router.js')).to.not.contain("this.route('index')");
+ it('route foo/bar', function () {
+ return emberGenerateDestroy(['route', 'foo/bar'], (_file) => {
+ expect(_file('addon/templates/foo/bar.hbs')).to.equal('{{outlet}}');
+ });
});
});
- it('route application', function() {
- fs.removeSync('src/ui/routes/application/template.hbs');
- return emberGenerate(['route', 'application']).then(() => {
- expect(file('src/ui/routes/application/template.hbs')).to.exist;
- expect(file('src/router.js')).to.not.contain("this.route('application')");
- });
- });
+ it('using a `router.ts` file', async function () {
+ fs.moveSync('tests/dummy/app/router.js', 'tests/dummy/app/router.ts');
- it('route basic', function() {
- return emberGenerateDestroy(['route', 'basic'], _file => {
- expect(_file('src/ui/routes/basic/route.js')).to.exist;
- expect(file('src/router.js')).to.not.contain("this.route('basic')");
- }).then(() => {
- expect(file('src/router.js')).to.not.contain("this.route('basic')");
- });
- });
+ await emberGenerate(['route', 'foo', '--dummy']);
+ expect(file('tests/dummy/app/router.ts')).to.contain("this.route('foo')");
- it('route foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['route', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
+ await emberDestroy(['route', 'foo', '--dummy']);
+ expect(file('tests/dummy/app/router.ts')).to.not.contain("this.route('foo')");
});
- it('route foo --pod with --path', function() {
- return expectError(
- emberGenerateDestroy(['route', 'foo', '--pod', '--path=:foo_id/show']),
- "Pods aren't supported within a module unification app"
- );
- });
+ it('throws a helpful error if a router file could not be found', async function () {
+ fs.removeSync('tests/dummy/app/router.js');
- it('route index --pod', function() {
- return expectError(
- emberGenerate(['route', 'index', '--pod']),
- "Pods aren't supported within a module unification app"
+ await expect(emberGenerate(['route', 'foo', '--dummy'])).to.be.rejectedWith(
+ 'Could not find a router file. Please make sure your project has a `router.js` or `router.ts` file.'
);
});
- it('route application --pod', function() {
- return expectError(
- emberGenerate(['route', 'application', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
+ it('throws a helpful error if both a `router.ts` and `router.js` file are found', async function () {
+ fs.copySync('tests/dummy/app/router.js', 'tests/dummy/app/router.ts');
- it('route basic --pod', function() {
- return expectError(
- emberGenerate(['route', 'basic', '--pod']),
- "Pods aren't supported within a module unification app"
+ await expect(emberGenerate(['route', 'foo', '--dummy'])).to.be.rejectedWith(
+ 'Found both a `router.js` and `router.ts` file. Please make sure your project only has one or the other.'
);
});
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('route foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['route', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
+ describe('in in-repo-addon', function () {
+ enableOctane();
+ beforeEach(function () {
+ return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
+ { name: 'ember-page-title', dev: true },
])
)
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
- expect(_file('src/ui/routes/foo.js/route.js')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo.js/route-test.js')).to.not.exist;
-
- expect(_file('src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo/bar', function() {
- return emberGenerateDestroy(['route', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/route.js')).to.equal(fixture('route/route-nested.js'));
-
- expect(_file('src/ui/routes/foo/bar/template.hbs')).to.equal('{{outlet}}');
+ it('route foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['route', 'foo', '--in-repo-addon=my-addon'], (_file) => {
+ expect(_file('lib/my-addon/addon/routes/foo.js')).to.equal(fixture('route/route.js'));
- expect(_file('src/ui/routes/foo/bar/route-test.js')).to.equal(
- fixture('route-test/default-nested.js')
+ expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal(
+ '{{page-title "Foo"}}\n{{outlet}}'
);
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('bar')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('bar')");
- });
- });
-
- it('route foo --dummy', function() {
- return emberGenerateDestroy(['route', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('tests/dummy/src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route.js')).to.not.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo/route-test.js')).to.not.exist;
-
- expect(file('tests/dummy/src/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js --dummy', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo.js/route.js')).to.not.exist;
- expect(_file('tests/dummy/src/ui/routes/foo.js/template.hbs')).to.not.exist;
-
- expect(_file('tests/dummy/src/ui/routes/foo/route.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('tests/dummy/src/ui/routes/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route.js')).to.not.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo/route-test.js')).to.not.exist;
-
- expect(file('tests/dummy/src/router.js')).to.contain("this.route('foo')");
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo/bar --dummy', function() {
- return emberGenerateDestroy(['route', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/bar/route.js')).to.equal(
- fixture('route/route-nested.js')
+ expect(_file('lib/my-addon/app/routes/foo.js')).to.contain(
+ "export { default } from 'my-addon/routes/foo';"
);
- expect(_file('tests/dummy/src/ui/routes/foo/bar/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('src/ui/routes/foo/route.js')).to.not.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo/route-test.js')).to.not.exist;
-
- expect(file('tests/dummy/src/router.js'))
- .to.contain("this.route('foo', function() {")
- .to.contain("this.route('bar')");
- }).then(() => {
- expect(file('tests/dummy/src/router.js')).to.not.contain("this.route('bar')");
- });
- });
-
- it('route foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['route', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
-
- describe('in app - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
- expect(_file('app/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('lib/my-addon/app/templates/foo.js')).to.contain(
+ "export { default } from 'my-addon/templates/foo';"
+ );
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
});
});
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo.js'], _file => {
- expect(_file('app/routes/foo.js.js')).to.not.exist;
- expect(_file('app/templates/foo.js.hbs')).to.not.exist;
+ it('route foo.js --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['route', 'foo.js', '--in-repo-addon=my-addon'], (_file) => {
+ expect(_file('lib/my-addon/addon/routes/foo.js.js')).to.not.exist;
+ expect(_file('lib/my-addon/addon/templates/foo.js.hbs')).to.not.exist;
+ expect(_file('lib/my-addon/app/routes/foo.js.js')).to.not.exist;
+ expect(_file('lib/my-addon/app/templates/foo.js.js')).to.not.exist;
expect(_file('tests/unit/routes/foo.js-test.js')).to.not.exist;
- expect(_file('app/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- expect(file('app/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- });
- });
+ expect(_file('lib/my-addon/addon/routes/foo.js')).to.equal(fixture('route/route.js'));
- it('route foo --skip-router', function() {
- return emberGenerateDestroy(['route', 'foo', '--skip-router'], _file => {
- expect(_file('app/routes/foo.js')).to.exist;
- expect(_file('app/templates/foo.hbs')).to.exist;
- expect(_file('tests/unit/routes/foo-test.js')).to.exist;
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- });
- });
+ expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal(
+ '{{page-title "Foo"}}\n{{outlet}}'
+ );
- it('route foo --path=:foo_id/show', function() {
- return emberGenerateDestroy(['route', 'foo', '--path=:foo_id/show'], _file => {
- expect(_file('app/routes/foo.js')).to.equal(fixture('route/native-route.js'));
+ expect(_file('lib/my-addon/app/routes/foo.js')).to.contain(
+ "export { default } from 'my-addon/routes/foo';"
+ );
- expect(_file('app/templates/foo.hbs')).to.equal('{{outlet}}');
+ expect(_file('lib/my-addon/app/templates/foo.js')).to.contain(
+ "export { default } from 'my-addon/templates/foo';"
+ );
expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('app/router.js'))
- .to.contain("this.route('foo', {")
- .to.contain("path: ':foo_id/show'")
- .to.contain('});');
- }).then(() => {
- expect(file('app/router.js'))
- .to.not.contain("this.route('foo'")
- .to.not.contain("path: ':foo_id/show'");
});
});
- it('route parent/child --reset-namespace', function() {
- return emberGenerateDestroy(['route', 'parent/child', '--reset-namespace'], _file => {
- expect(_file('app/routes/child.js')).to.equal(fixture('route/native-route-child.js'));
+ it('route foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['route', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
+ expect(_file('lib/my-addon/addon/routes/foo/bar.js')).to.equal(
+ fixture('route/route-nested.js')
+ );
- expect(_file('app/templates/child.hbs')).to.equal('{{outlet}}');
+ expect(_file('lib/my-addon/addon/templates/foo/bar.hbs')).to.equal(
+ '{{page-title "Bar"}}\n{{outlet}}'
+ );
- expect(_file('tests/unit/routes/child-test.js')).to.equal(
- fixture('route-test/default-child.js')
+ expect(_file('lib/my-addon/app/routes/foo/bar.js')).to.contain(
+ "export { default } from 'my-addon/routes/foo/bar';"
);
- expect(file('app/router.js'))
- .to.contain("this.route('parent', {")
- .to.contain("this.route('child', {")
- .to.contain('resetNamespace: true')
- .to.contain('});');
+ expect(_file('lib/my-addon/app/templates/foo/bar.js')).to.contain(
+ "export { default } from 'my-addon/templates/foo/bar';"
+ );
+
+ expect(_file('tests/unit/routes/foo/bar-test.js')).to.equal(
+ fixture('route-test/default-nested.js')
+ );
});
});
- it('route parent/child --reset-namespace --pod', function() {
- return emberGenerateDestroy(
- ['route', 'parent/child', '--reset-namespace', '--pod'],
- _file => {
- expect(_file('app/child/route.js')).to.equal(fixture('route/native-route-child.js'));
-
- expect(_file('app/child/template.hbs')).to.equal('{{outlet}}');
+ describe('ember-page-title is not installed', function () {
+ beforeEach(function () {
+ return modifyPackages([{ name: 'ember-page-title', delete: true }]);
+ });
- expect(_file('tests/unit/child/route-test.js')).to.equal(
- fixture('route-test/default-child.js')
- );
+ it('route foo', function () {
+ return emberGenerateDestroy(['route', 'foo', '--in-repo-addon=my-addon'], (_file) => {
+ expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal('{{outlet}}');
+ });
+ });
- expect(file('app/router.js'))
- .to.contain("this.route('parent', {")
- .to.contain("this.route('child', {")
- .to.contain('resetNamespace: true')
- .to.contain('});');
- }
- );
- });
-
- it('route index', function() {
- return emberGenerateDestroy(['route', 'index'], _file => {
- expect(_file('app/routes/index.js')).to.exist;
- expect(_file('app/templates/index.hbs')).to.exist;
- expect(_file('tests/unit/routes/index-test.js')).to.exist;
- expect(file('app/router.js')).to.not.contain("this.route('index')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('index')");
- });
- });
-
- it('route application', function() {
- fs.removeSync('app/templates/application.hbs');
- return emberGenerate(['route', 'application']).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('application')");
- });
- });
-
- it('route basic', function() {
- return emberGenerateDestroy(['route', 'basic'], _file => {
- expect(_file('app/routes/basic.js')).to.exist;
- expect(file('app/router.js')).to.not.contain("this.route('basic')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('basic')");
- });
- });
-
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
- expect(_file('app/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--pod'], _file => {
- expect(_file('app/foo.js/route.js')).to.not.exist;
- expect(_file('app/foo.js/template.hbs')).to.not.exist;
- expect(_file('tests/unit/foo.js/route-test.js')).to.not.exist;
-
- expect(_file('app/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- expect(file('app/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo --pod with --path', function() {
- return emberGenerate(['route', 'foo', '--pod', '--path=:foo_id/show'])
- .then(() =>
- expect(file('app/router.js'))
- .to.contain("this.route('foo', {")
- .to.contain("path: ':foo_id/show'")
- .to.contain('});')
- )
-
- .then(() => emberDestroy(['route', 'foo', '--pod', '--path=:foo_id/show']))
- .then(() =>
- expect(file('app/router.js'))
- .to.not.contain("this.route('foo', {")
- .to.not.contain("path: ':foo_id/show'")
- );
- });
-
- it('route index --pod', function() {
- return emberGenerate(['route', 'index', '--pod']).then(() =>
- expect(file('app/router.js')).to.not.contain("this.route('index')")
- );
- });
-
- it('route application --pod', function() {
- return emberGenerate(['route', 'application', '--pod'])
- .then(() => expect(file('app/application/route.js')).to.exist)
- .then(() => expect(file('app/application/template.hbs')).to.exist)
- .then(() => expect(file('app/router.js')).to.not.contain("this.route('application')"));
- });
-
- it('route basic --pod', function() {
- return emberGenerateDestroy(['route', 'basic', '--pod'], _file => {
- expect(_file('app/basic/route.js')).to.exist;
- expect(file('app/router.js')).to.not.contain("this.route('index')");
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
- expect(_file('app/pods/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/pods/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('tests/unit/pods/foo/route-test.js')).to.equal(
- fixture('route-test/default.js')
- );
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--pod'], _file => {
- expect(_file('app/pods/foo.js/route.js')).to.not.exist;
- expect(_file('app/pods/foo.js/template.hbs')).to.not.exist;
- expect(_file('tests/unit/pods/foo.js/route-test.js')).to.not.exist;
-
- expect(_file('app/pods/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('app/pods/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('tests/unit/pods/foo/route-test.js')).to.equal(
- fixture('route-test/default.js')
- );
-
- expect(file('app/router.js')).to.contain("this.route('foo')");
- expect(file('app/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('app/router.js')).to.not.contain("this.route('foo')");
+ it('route foo/bar', function () {
+ return emberGenerateDestroy(['route', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
+ expect(_file('lib/my-addon/addon/templates/foo/bar.hbs')).to.equal('{{outlet}}');
});
});
});
});
-
- describe('in addon - octane', function() {
- enableOctane();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('route foo', function() {
- return emberGenerateDestroy(['route', 'foo'], _file => {
- expect(_file('addon/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('addon/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo.js')).to.contain(
- "export { default } from 'my-addon/routes/foo';"
- );
-
- expect(_file('app/templates/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/foo';"
- );
-
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js', function() {
- return emberGenerateDestroy(['route', 'foo.js'], _file => {
- expect(_file('addon/routes/foo.js.js')).to.not.exist;
- expect(_file('addon/templates/foo.js.hbs')).to.not.exist;
- expect(_file('app/routes/foo.js.js')).to.not.exist;
- expect(_file('app/templates/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/routes/foo.js-test.js')).to.not.exist;
-
- expect(_file('addon/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('addon/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo.js')).to.contain(
- "export { default } from 'my-addon/routes/foo';"
- );
-
- expect(_file('app/templates/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/foo';"
- );
-
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
-
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo/bar', function() {
- return emberGenerateDestroy(['route', 'foo/bar'], _file => {
- expect(_file('addon/routes/foo/bar.js')).to.equal(fixture('route/native-route-nested.js'));
-
- expect(_file('addon/templates/foo/bar.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/routes/foo/bar';"
- );
-
- expect(_file('app/templates/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/templates/foo/bar';"
- );
-
- expect(_file('tests/unit/routes/foo/bar-test.js')).to.equal(
- fixture('route-test/default-nested.js')
- );
-
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('bar')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('bar')");
- });
- });
-
- it('route foo --dummy', function() {
- return emberGenerateDestroy(['route', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/app/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo.js')).to.not.exist;
- expect(_file('app/templates/foo.hbs')).to.not.exist;
- expect(_file('tests/unit/routes/foo-test.js')).to.not.exist;
-
- expect(file('tests/dummy/app/router.js')).to.contain("this.route('foo')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo.js --dummy', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/routes/foo.js.js')).to.not.exist;
- expect(_file('tests/dummy/app/templates/foo.js.hbs')).to.not.exist;
-
- expect(_file('tests/dummy/app/routes/foo.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo.js')).to.not.exist;
- expect(_file('app/templates/foo.hbs')).to.not.exist;
- expect(_file('tests/unit/routes/foo-test.js')).to.not.exist;
-
- expect(file('tests/dummy/app/router.js')).to.contain("this.route('foo')");
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo.js')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('foo')");
- });
- });
-
- it('route foo/bar --dummy', function() {
- return emberGenerateDestroy(['route', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/app/routes/foo/bar.js')).to.equal(
- fixture('route/native-route-nested.js')
- );
-
- expect(_file('tests/dummy/app/templates/foo/bar.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/routes/foo/bar.js')).to.not.exist;
- expect(_file('app/templates/foo/bar.hbs')).to.not.exist;
- expect(_file('tests/unit/routes/foo/bar-test.js')).to.not.exist;
-
- expect(file('tests/dummy/app/router.js'))
- .to.contain("this.route('foo', function() {")
- .to.contain("this.route('bar')");
- }).then(() => {
- expect(file('tests/dummy/app/router.js')).to.not.contain("this.route('bar')");
- });
- });
-
- it('route foo --pod', function() {
- return emberGenerateDestroy(['route', 'foo', '--pod'], _file => {
- expect(_file('addon/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('addon/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/foo/route.js')).to.contain(
- "export { default } from 'my-addon/foo/route';"
- );
-
- expect(_file('app/foo/template.js')).to.contain(
- "export { default } from 'my-addon/foo/template';"
- );
-
- expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
- });
- });
-
- it('route foo.js --pod', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--pod'], _file => {
- expect(_file('addon/foo.js/route.js')).to.not.exist;
- expect(_file('addon/foo.js/template.hbs')).to.not.exist;
- expect(_file('app/foo.js/route.js')).to.not.exist;
- expect(_file('app/foo.js/template.js')).to.not.exist;
- expect(_file('tests/unit/foo.js/route-test.js')).to.not.exist;
-
- expect(_file('addon/foo/route.js')).to.equal(fixture('route/native-route.js'));
-
- expect(_file('addon/foo/template.hbs')).to.equal('{{outlet}}');
-
- expect(_file('app/foo/route.js')).to.contain(
- "export { default } from 'my-addon/foo/route';"
- );
-
- expect(_file('app/foo/template.js')).to.contain(
- "export { default } from 'my-addon/foo/template';"
- );
-
- expect(_file('tests/unit/foo/route-test.js')).to.equal(fixture('route-test/default.js'));
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
- return emberNew({ target: 'in-repo-addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('route foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['route', 'foo', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/routes/foo.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('lib/my-addon/app/routes/foo.js')).to.contain(
- "export { default } from 'my-addon/routes/foo';"
- );
-
- expect(_file('lib/my-addon/app/templates/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/foo';"
- );
-
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
- });
- });
-
- it('route foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['route', 'foo.js', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/routes/foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/addon/templates/foo.js.hbs')).to.not.exist;
- expect(_file('lib/my-addon/app/routes/foo.js.js')).to.not.exist;
- expect(_file('lib/my-addon/app/templates/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/routes/foo.js-test.js')).to.not.exist;
-
- expect(_file('lib/my-addon/addon/routes/foo.js')).to.equal(fixture('route/route.js'));
-
- expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal('{{outlet}}');
-
- expect(_file('lib/my-addon/app/routes/foo.js')).to.contain(
- "export { default } from 'my-addon/routes/foo';"
- );
-
- expect(_file('lib/my-addon/app/templates/foo.js')).to.contain(
- "export { default } from 'my-addon/templates/foo';"
- );
-
- expect(_file('tests/unit/routes/foo-test.js')).to.equal(fixture('route-test/default.js'));
- });
- });
-
- it('route foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['route', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
- expect(_file('lib/my-addon/addon/routes/foo/bar.js')).to.equal(
- fixture('route/route-nested.js')
- );
-
- expect(_file('lib/my-addon/addon/templates/foo/bar.hbs')).to.equal('{{outlet}}');
-
- expect(_file('lib/my-addon/app/routes/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/routes/foo/bar';"
- );
-
- expect(_file('lib/my-addon/app/templates/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/templates/foo/bar';"
- );
-
- expect(_file('tests/unit/routes/foo/bar-test.js')).to.equal(
- fixture('route-test/default-nested.js')
- );
- });
- });
- });
});
diff --git a/node-tests/blueprints/service-test-test.js b/node-tests/blueprints/service-test-test.js
index 6f887cb7d36..66dd4feac79 100644
--- a/node-tests/blueprints/service-test-test.js
+++ b/node-tests/blueprints/service-test-test.js
@@ -12,16 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-describe('Blueprint: service-test', function() {
+describe('Blueprint: service-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -29,8 +29,8 @@ describe('Blueprint: service-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/default.js')
);
@@ -38,8 +38,8 @@ describe('Blueprint: service-test', function() {
});
});
- describe('with ember-cli-mocha@0.11.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.11.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -47,16 +47,16 @@ describe('Blueprint: service-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.11.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/mocha.js')
);
});
});
- it('service-test foo --pod', function() {
- return emberGenerateDestroy(['service-test', 'foo', '--pod'], _file => {
+ it('service-test foo --pod', function () {
+ return emberGenerateDestroy(['service-test', 'foo', '--pod'], (_file) => {
expect(_file('tests/unit/foo/service-test.js')).to.equal(
fixture('service-test/mocha.js')
);
@@ -64,8 +64,8 @@ describe('Blueprint: service-test', function() {
});
});
- describe('with ember-cli-mocha@0.12.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha@0.12.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
@@ -73,16 +73,16 @@ describe('Blueprint: service-test', function() {
generateFakePackageManifest('ember-cli-mocha', '0.12.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/mocha-0.12.js')
);
});
});
- it('service-test foo --pod', function() {
- return emberGenerateDestroy(['service-test', 'foo', '--pod'], _file => {
+ it('service-test foo --pod', function () {
+ return emberGenerateDestroy(['service-test', 'foo', '--pod'], (_file) => {
expect(_file('tests/unit/foo/service-test.js')).to.equal(
fixture('service-test/mocha-0.12.js')
);
@@ -90,14 +90,17 @@ describe('Blueprint: service-test', function() {
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/mocha-rfc232.js')
);
@@ -105,8 +108,8 @@ describe('Blueprint: service-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -114,8 +117,8 @@ describe('Blueprint: service-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/rfc232.js')
);
@@ -124,13 +127,13 @@ describe('Blueprint: service-test', function() {
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -138,8 +141,8 @@ describe('Blueprint: service-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('service-test foo', function() {
- return emberGenerateDestroy(['service-test', 'foo'], _file => {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
expect(_file('tests/unit/services/foo-test.js')).to.equal(
fixture('service-test/default.js')
);
@@ -148,5 +151,33 @@ describe('Blueprint: service-test', function() {
});
});
});
+
+ describe('with ember-qunit (default)', function () {
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/services/foo-test.js')).to.equal(
+ fixture('service-test/rfc232-addon.js')
+ );
+ });
+ });
+ });
+
+ describe('with ember-mocha@0.16.2', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
+ generateFakePackageManifest('ember-mocha', '0.16.2');
+ });
+
+ it('service-test foo', function () {
+ return emberGenerateDestroy(['service-test', 'foo'], (_file) => {
+ expect(_file('tests/unit/services/foo-test.js')).to.equal(
+ fixture('service-test/mocha-rfc232-addon.js')
+ );
+ });
+ });
+ });
});
});
diff --git a/node-tests/blueprints/service-test.js b/node-tests/blueprints/service-test.js
index b9b7edfc4ce..6ccb39191b3 100644
--- a/node-tests/blueprints/service-test.js
+++ b/node-tests/blueprints/service-test.js
@@ -6,7 +6,6 @@ const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
@@ -15,14 +14,15 @@ const generateFakePackageManifest = require('../helpers/generate-fake-package-ma
const fixture = require('../helpers/fixture');
const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
const enableOctane = setupTestEnvironment.enableOctane;
-describe('Blueprint: service', function() {
+describe('Blueprint: service', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app - octane', function () {
+ enableOctane();
+
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -33,8 +33,8 @@ describe('Blueprint: service', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
+ it('service foo', function () {
+ return emberGenerateDestroy(['service', 'foo'], (_file) => {
expect(_file('app/services/foo.js')).to.equal(fixture('service/service.js'));
expect(_file('tests/unit/services/foo-test.js')).to.equal(
@@ -43,10 +43,10 @@ describe('Blueprint: service', function() {
});
});
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo.js'], _file => {
+ it('service foo.js', function () {
+ return emberGenerateDestroy(['service', 'foo.js'], (_file) => {
expect(_file('app/services/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/services/foo-test.js.js')).to.not.exist;
+ expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
expect(_file('app/services/foo.js')).to.equal(fixture('service/service.js'));
@@ -56,8 +56,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
+ it('service foo/bar', function () {
+ return emberGenerateDestroy(['service', 'foo/bar'], (_file) => {
expect(_file('app/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
expect(_file('tests/unit/services/foo/bar-test.js')).to.equal(
@@ -66,8 +66,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo --pod', function() {
- return emberGenerateDestroy(['service', 'foo', '--pod'], _file => {
+ it('service foo --pod', function () {
+ return emberGenerateDestroy(['service', 'foo', '--pod'], (_file) => {
expect(_file('app/foo/service.js')).to.equal(fixture('service/service.js'));
expect(_file('tests/unit/foo/service-test.js')).to.equal(
@@ -76,8 +76,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo.js --pod', function() {
- return emberGenerateDestroy(['service', 'foo.js', '--pod'], _file => {
+ it('service foo.js --pod', function () {
+ return emberGenerateDestroy(['service', 'foo.js', '--pod'], (_file) => {
expect(_file('app/foo.js/service.js')).to.not.exist;
expect(_file('tests/unit/foo.js/service-test.js')).to.not.exist;
@@ -89,8 +89,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar --pod', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--pod'], _file => {
+ it('service foo/bar --pod', function () {
+ return emberGenerateDestroy(['service', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/foo/bar/service.js')).to.equal(fixture('service/service-nested.js'));
expect(_file('tests/unit/foo/bar/service-test.js')).to.equal(
@@ -99,13 +99,15 @@ describe('Blueprint: service', function() {
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ enableOctane();
+
+ beforeEach(function () {
setupPodConfig({ podModulePrefix: true });
});
- it('service foo --pod', function() {
- return emberGenerateDestroy(['service', 'foo', '--pod'], _file => {
+ it('service foo --pod', function () {
+ return emberGenerateDestroy(['service', 'foo', '--pod'], (_file) => {
expect(_file('app/pods/foo/service.js')).to.equal(fixture('service/service.js'));
expect(_file('tests/unit/pods/foo/service-test.js')).to.equal(
@@ -114,8 +116,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo.js --pod', function() {
- return emberGenerateDestroy(['service', 'foo.js', '--pod'], _file => {
+ it('service foo.js --pod', function () {
+ return emberGenerateDestroy(['service', 'foo.js', '--pod'], (_file) => {
expect(_file('app/pods/foo.js/service.js')).to.not.exist;
expect(_file('tests/unit/pods/foo.js/service-test.js')).to.not.exist;
@@ -127,8 +129,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar --pod', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--pod'], _file => {
+ it('service foo/bar --pod', function () {
+ return emberGenerateDestroy(['service', 'foo/bar', '--pod'], (_file) => {
expect(_file('app/pods/foo/bar/service.js')).to.equal(
fixture('service/service-nested.js')
);
@@ -141,185 +143,10 @@ describe('Blueprint: service', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
- expect(_file('src/services/foo.js')).to.equal(fixture('service/service.js'));
-
- expect(_file('src/services/foo-test.js')).to.equal(fixture('service-test/default.js'));
- });
- });
-
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo.js'], _file => {
- expect(_file('src/services/foo.js.js')).to.not.exist;
- expect(_file('src/services/foo.js-test.js')).to.not.exist;
-
- expect(_file('src/services/foo.js')).to.equal(fixture('service/service.js'));
-
- expect(_file('src/services/foo-test.js')).to.equal(fixture('service-test/default.js'));
- });
- });
-
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
- expect(_file('src/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
-
- expect(_file('src/services/foo/bar-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
- });
- });
-
- it('service foo --pod', function() {
- return expectError(
- emberGenerateDestroy(['service', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
-
- describe('in app - octane', function() {
+ describe('in addon - octane', function () {
enableOctane();
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
- expect(_file('app/services/foo.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/services/foo-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo.js'], _file => {
- expect(_file('app/services/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
-
- expect(_file('app/services/foo.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/services/foo-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
- expect(_file('app/services/foo/bar.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
-
- expect(_file('tests/unit/services/foo/bar-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
- });
- });
-
- it('service foo --pod', function() {
- return emberGenerateDestroy(['service', 'foo', '--pod'], _file => {
- expect(_file('app/foo/service.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/foo/service-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo.js --pod', function() {
- return emberGenerateDestroy(['service', 'foo.js', '--pod'], _file => {
- expect(_file('app/foo.js/service.js')).to.not.exist;
- expect(_file('tests/unit/foo.js/service-test.js')).to.not.exist;
-
- expect(_file('app/foo/service.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/foo/service-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo/bar --pod', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--pod'], _file => {
- expect(_file('app/foo/bar/service.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
-
- expect(_file('tests/unit/foo/bar/service-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
- });
- });
-
- describe('with podModulePrefix', function() {
- beforeEach(function() {
- setupPodConfig({ podModulePrefix: true });
- });
-
- it('service foo --pod', function() {
- return emberGenerateDestroy(['service', 'foo', '--pod'], _file => {
- expect(_file('app/pods/foo/service.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/pods/foo/service-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo.js --pod', function() {
- return emberGenerateDestroy(['service', 'foo.js', '--pod'], _file => {
- expect(_file('app/pods/foo.js/service.js')).to.not.exist;
- expect(_file('tests/unit/pods/foo.js/service-test.js')).to.not.exist;
-
- expect(_file('app/pods/foo/service.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('tests/unit/pods/foo/service-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo/bar --pod', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--pod'], _file => {
- expect(_file('app/pods/foo/bar/service.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
-
- expect(_file('tests/unit/pods/foo/bar/service-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
- });
- });
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -330,8 +157,8 @@ describe('Blueprint: service', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
+ it('service foo', function () {
+ return emberGenerateDestroy(['service', 'foo'], (_file) => {
expect(_file('addon/services/foo.js')).to.equal(fixture('service/service.js'));
expect(_file('app/services/foo.js')).to.contain(
@@ -344,8 +171,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo.js'], _file => {
+ it('service foo.js', function () {
+ return emberGenerateDestroy(['service', 'foo.js'], (_file) => {
expect(_file('addon/services/foo.js.js')).to.not.exist;
expect(_file('app/services/foo.js.js')).to.not.exist;
expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
@@ -362,8 +189,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
+ it('service foo/bar', function () {
+ return emberGenerateDestroy(['service', 'foo/bar'], (_file) => {
expect(_file('addon/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
expect(_file('app/services/foo/bar.js')).to.contain(
@@ -376,8 +203,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--dummy'], _file => {
+ it('service foo/bar --dummy', function () {
+ return emberGenerateDestroy(['service', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
fixture('service/service-nested.js')
);
@@ -385,8 +212,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar.js --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar.js', '--dummy'], _file => {
+ it('service foo/bar.js --dummy', function () {
+ return emberGenerateDestroy(['service', 'foo/bar.js', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/services/foo/bar.js.js')).to.not.exist;
expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
@@ -397,161 +224,10 @@ describe('Blueprint: service', function() {
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
- expect(_file('src/services/foo.js')).to.equal(fixture('service/service.js'));
-
- expect(_file('src/services/foo-test.js')).to.equal(fixture('service-test/default.js'));
-
- expect(_file('app/services/foo.js')).to.not.exist;
- });
- });
-
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
- expect(_file('src/services/foo.js.js')).to.not.exist;
- expect(_file('src/services/foo.js-test.js')).to.not.exist;
-
- expect(_file('src/services/foo.js')).to.equal(fixture('service/service.js'));
-
- expect(_file('src/services/foo-test.js')).to.equal(fixture('service-test/default.js'));
-
- expect(_file('app/services/foo.js')).to.not.exist;
- });
- });
-
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
- expect(_file('src/services/foo/bar.js')).to.equal(fixture('service/service-nested.js'));
-
- expect(_file('src/services/foo/bar-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
-
- expect(_file('app/services/foo/bar.js')).to.not.exist;
- });
- });
-
- it('service foo/bar --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/services/foo/bar.js')).to.equal(
- fixture('service/service-nested.js')
- );
- expect(_file('src/services/foo/bar.js')).to.not.exist;
- });
- });
-
- it('service foo/bar.js --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/services/foo/bar.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/src/services/foo/bar.js')).to.equal(
- fixture('service/service-nested.js')
- );
- expect(_file('src/services/foo/bar.js')).to.not.exist;
- });
- });
- });
-
- describe('in addon - octane', function() {
+ describe('in in-repo-addon', function () {
enableOctane();
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('service foo', function() {
- return emberGenerateDestroy(['service', 'foo'], _file => {
- expect(_file('addon/services/foo.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('app/services/foo.js')).to.contain(
- "export { default } from 'my-addon/services/foo';"
- );
-
- expect(_file('tests/unit/services/foo-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo.js', function() {
- return emberGenerateDestroy(['service', 'foo.js'], _file => {
- expect(_file('addon/services/foo.js.js')).to.not.exist;
- expect(_file('app/services/foo.js.js')).to.not.exist;
- expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
-
- expect(_file('addon/services/foo.js')).to.equal(fixture('service/native-service.js'));
-
- expect(_file('app/services/foo.js')).to.contain(
- "export { default } from 'my-addon/services/foo';"
- );
-
- expect(_file('tests/unit/services/foo-test.js')).to.equal(
- fixture('service-test/default.js')
- );
- });
- });
-
- it('service foo/bar', function() {
- return emberGenerateDestroy(['service', 'foo/bar'], _file => {
- expect(_file('addon/services/foo/bar.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
-
- expect(_file('app/services/foo/bar.js')).to.contain(
- "export { default } from 'my-addon/services/foo/bar';"
- );
-
- expect(_file('tests/unit/services/foo/bar-test.js')).to.equal(
- fixture('service-test/default-nested.js')
- );
- });
- });
-
- it('service foo/bar --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
- expect(_file('addon/services/foo/bar.js')).to.not.exist;
- });
- });
-
- it('service foo/bar.js --dummy', function() {
- return emberGenerateDestroy(['service', 'foo/bar.js', '--dummy'], _file => {
- expect(_file('tests/dummy/app/services/foo/bar.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/app/services/foo/bar.js')).to.equal(
- fixture('service/native-service-nested.js')
- );
- expect(_file('addon/services/foo/bar.js')).to.not.exist;
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -562,8 +238,8 @@ describe('Blueprint: service', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('service foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['service', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('service foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['service', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/services/foo.js')).to.equal(fixture('service/service.js'));
expect(_file('lib/my-addon/app/services/foo.js')).to.contain(
@@ -576,8 +252,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['service', 'foo.js', '--in-repo-addon=my-addon'], _file => {
+ it('service foo.js --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['service', 'foo.js', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/services/foo.js.js')).to.not.exist;
expect(_file('lib/my-addon/app/services/foo.js.js')).to.not.exist;
expect(_file('tests/unit/services/foo.js-test.js')).to.not.exist;
@@ -594,8 +270,8 @@ describe('Blueprint: service', function() {
});
});
- it('service foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['service', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
+ it('service foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['service', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/services/foo/bar.js')).to.equal(
fixture('service/service-nested.js')
);
diff --git a/node-tests/blueprints/template-test.js b/node-tests/blueprints/template-test.js
index 72ff75c7b41..6891380775d 100644
--- a/node-tests/blueprints/template-test.js
+++ b/node-tests/blueprints/template-test.js
@@ -5,249 +5,157 @@ const setupTestHooks = blueprintHelpers.setupTestHooks;
const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: template', function() {
+describe('Blueprint: template', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
+ it('template foo', function () {
+ return emberGenerateDestroy(['template', 'foo'], (_file) => {
expect(_file('app/templates/foo.hbs')).to.equal('');
});
});
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
+ it('template foo.hbs', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs'], (_file) => {
expect(_file('app/templates/foo.hbs.hbs')).to.not.exist;
expect(_file('app/templates/foo.hbs')).to.equal('');
});
});
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
+ it('template foo/bar', function () {
+ return emberGenerateDestroy(['template', 'foo/bar'], (_file) => {
expect(_file('app/templates/foo/bar.hbs')).to.equal('');
});
});
- describe('with usePods', function() {
- beforeEach(function() {
+ describe('with usePods', function () {
+ beforeEach(function () {
setupPodConfig({ usePods: true });
});
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
+ it('template foo', function () {
+ return emberGenerateDestroy(['template', 'foo'], (_file) => {
expect(_file('app/foo/template.hbs')).to.equal('');
});
});
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
+ it('template foo.hbs', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs'], (_file) => {
expect(_file('app/foo.hbs/template.hbs')).to.not.exist;
expect(_file('app/foo/template.hbs')).to.equal('');
});
});
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
+ it('template foo/bar', function () {
+ return emberGenerateDestroy(['template', 'foo/bar'], (_file) => {
expect(_file('app/foo/bar/template.hbs')).to.equal('');
});
});
});
- describe('with usePods + podModulePrefix', function() {
- beforeEach(function() {
+ describe('with usePods + podModulePrefix', function () {
+ beforeEach(function () {
setupPodConfig({
usePods: true,
podModulePrefix: true,
});
});
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
+ it('template foo', function () {
+ return emberGenerateDestroy(['template', 'foo'], (_file) => {
expect(_file('app/pods/foo/template.hbs')).to.equal('');
});
});
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
+ it('template foo.hbs', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs'], (_file) => {
expect(_file('app/pods/foo.hbs/template.hbs')).to.not.exist;
expect(_file('app/pods/foo/template.hbs')).to.equal('');
});
});
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
+ it('template foo/bar', function () {
+ return emberGenerateDestroy(['template', 'foo/bar'], (_file) => {
expect(_file('app/pods/foo/bar/template.hbs')).to.equal('');
});
});
});
});
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
+ it('template foo', function () {
+ return emberGenerateDestroy(['template', 'foo'], (_file) => {
expect(_file('addon/templates/foo.hbs')).to.equal('');
});
});
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
+ it('template foo.hbs', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs'], (_file) => {
expect(_file('addon/templates/foo.hbs.hbs')).to.not.exist;
expect(_file('addon/templates/foo.hbs')).to.equal('');
});
});
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
+ it('template foo/bar', function () {
+ return emberGenerateDestroy(['template', 'foo/bar'], (_file) => {
expect(_file('addon/templates/foo/bar.hbs')).to.equal('');
});
});
- it('template foo --dummy', function() {
- return emberGenerateDestroy(['template', 'foo', '--dummy'], _file => {
+ it('template foo --dummy', function () {
+ return emberGenerateDestroy(['template', 'foo', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('');
});
});
- it('template foo.hbs --dummy', function() {
- return emberGenerateDestroy(['template', 'foo.hbs', '--dummy'], _file => {
+ it('template foo.hbs --dummy', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/templates/foo.hbs.hbs')).to.not.exist;
expect(_file('tests/dummy/app/templates/foo.hbs')).to.equal('');
});
});
- it('template foo/bar --dummy', function() {
- return emberGenerateDestroy(['template', 'foo/bar', '--dummy'], _file => {
+ it('template foo/bar --dummy', function () {
+ return emberGenerateDestroy(['template', 'foo/bar', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/templates/foo/bar.hbs')).to.equal('');
});
});
});
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' });
});
- it('template foo --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['template', 'foo', '--in-repo-addon=my-addon'], _file => {
+ it('template foo --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['template', 'foo', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal('');
});
});
- it('template foo.hbs --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['template', 'foo.hbs', '--in-repo-addon=my-addon'], _file => {
+ it('template foo.hbs --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['template', 'foo.hbs', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/templates/foo.hbs.hbs')).to.not.exist;
expect(_file('lib/my-addon/addon/templates/foo.hbs')).to.equal('');
});
});
- it('template foo/bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['template', 'foo/bar', '--in-repo-addon=my-addon'], _file => {
+ it('template foo/bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['template', 'foo/bar', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/templates/foo/bar.hbs')).to.equal('');
});
});
});
-
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
- expect(_file('src/ui/routes/foo.hbs/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/template.hbs')).to.equal('');
- });
- });
- });
-
- describe('with usePods - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- it('shows an error', function() {
- return expectError(
- emberGenerateDestroy(['template', 'foo', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- it('template foo', function() {
- return emberGenerateDestroy(['template', 'foo'], _file => {
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo.hbs', function() {
- return emberGenerateDestroy(['template', 'foo.hbs'], _file => {
- expect(_file('src/ui/routes/foo.hbs/template.hbs')).to.not.exist;
- expect(_file('src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo/bar', function() {
- return emberGenerateDestroy(['template', 'foo/bar'], _file => {
- expect(_file('src/ui/routes/foo/bar/template.hbs')).to.equal('');
- });
- });
-
- it('template foo --dummy', function() {
- return emberGenerateDestroy(['template', 'foo', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo.hbs --dummy', function() {
- return emberGenerateDestroy(['template', 'foo.hbs', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo.hbs/template.hbs')).to.not.exist;
- expect(_file('tests/dummy/src/ui/routes/foo/template.hbs')).to.equal('');
- });
- });
-
- it('template foo/bar --dummy', function() {
- return emberGenerateDestroy(['template', 'foo/bar', '--dummy'], _file => {
- expect(_file('tests/dummy/src/ui/routes/foo/bar/template.hbs')).to.equal('');
- });
- });
- });
});
diff --git a/node-tests/blueprints/util-test-test.js b/node-tests/blueprints/util-test-test.js
index 08d15dedafa..27f122f9612 100644
--- a/node-tests/blueprints/util-test-test.js
+++ b/node-tests/blueprints/util-test-test.js
@@ -12,19 +12,16 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: util-test', function() {
+describe('Blueprint: util-test', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew();
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -32,8 +29,8 @@ describe('Blueprint: util-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
+ it('util-test foo-bar', function () {
+ return emberGenerateDestroy(['util-test', 'foo-bar'], (_file) => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(
fixture('util-test/default.js')
);
@@ -41,8 +38,8 @@ describe('Blueprint: util-test', function() {
});
});
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.2.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -50,8 +47,8 @@ describe('Blueprint: util-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.2.0');
});
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
+ it('util-test foo-bar', function () {
+ return emberGenerateDestroy(['util-test', 'foo-bar'], (_file) => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(
fixture('util-test/rfc232.js')
);
@@ -59,29 +56,32 @@ describe('Blueprint: util-test', function() {
});
});
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
+ describe('with ember-cli-mocha', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-mocha', dev: true },
]);
});
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
+ it('util-test foo-bar', function () {
+ return emberGenerateDestroy(['util-test', 'foo-bar'], (_file) => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(fixture('util-test/mocha.js'));
});
});
});
- describe('with ember-mocha@0.14.0', function() {
- beforeEach(function() {
- modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]);
+ describe('with ember-mocha@0.14.0', function () {
+ beforeEach(function () {
+ modifyPackages([
+ { name: 'ember-qunit', delete: true },
+ { name: 'ember-mocha', dev: true },
+ ]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
+ it('util-test foo-bar', function () {
+ return emberGenerateDestroy(['util-test', 'foo-bar'], (_file) => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(
fixture('util-test/mocha-rfc232.js')
);
@@ -90,68 +90,13 @@ describe('Blueprint: util-test', function() {
});
});
- describe('in app - module uninification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew();
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/default.js'));
- });
- });
- });
-
- describe('with ember-cli-qunit@4.2.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.2.0');
- });
-
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/rfc232.js'));
- });
- });
- });
-
- describe('with ember-cli-mocha', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-mocha', dev: true },
- ]);
- });
-
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/mocha.js'));
- });
- });
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' });
});
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
+ describe('with ember-cli-qunit@4.1.0', function () {
+ beforeEach(function () {
modifyPackages([
{ name: 'ember-qunit', delete: true },
{ name: 'ember-cli-qunit', dev: true },
@@ -159,35 +104,11 @@ describe('Blueprint: util-test', function() {
generateFakePackageManifest('ember-cli-qunit', '4.1.0');
});
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
+ it('util-test foo-bar', function () {
+ return emberGenerateDestroy(['util-test', 'foo-bar'], (_file) => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(fixture('util-test/dummy.js'));
});
});
});
});
-
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' });
- });
-
- describe('with ember-cli-qunit@4.1.0', function() {
- beforeEach(function() {
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ]);
- generateFakePackageManifest('ember-cli-qunit', '4.1.0');
- });
-
- it('util-test foo-bar', function() {
- return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/dummy.js'));
- });
- });
- });
- });
});
diff --git a/node-tests/blueprints/util-test.js b/node-tests/blueprints/util-test.js
index e11b1bed2e3..cc9d9d91641 100644
--- a/node-tests/blueprints/util-test.js
+++ b/node-tests/blueprints/util-test.js
@@ -6,7 +6,6 @@ const emberNew = blueprintHelpers.emberNew;
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy;
const setupPodConfig = blueprintHelpers.setupPodConfig;
const modifyPackages = blueprintHelpers.modifyPackages;
-const expectError = require('../helpers/expect-error');
const chai = require('ember-cli-blueprint-test-helpers/chai');
const expect = chai.expect;
@@ -14,14 +13,11 @@ const expect = chai.expect;
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest');
const fixture = require('../helpers/fixture');
-const setupTestEnvironment = require('../helpers/setup-test-environment');
-const enableModuleUnification = setupTestEnvironment.enableModuleUnification;
-
-describe('Blueprint: util', function() {
+describe('Blueprint: util', function () {
setupTestHooks(this);
- describe('in app', function() {
- beforeEach(function() {
+ describe('in app', function () {
+ beforeEach(function () {
return emberNew()
.then(() =>
modifyPackages([
@@ -32,16 +28,16 @@ describe('Blueprint: util', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('util foo-bar', function() {
- return emberGenerateDestroy(['util', 'foo-bar'], _file => {
+ it('util foo-bar', function () {
+ return emberGenerateDestroy(['util', 'foo-bar'], (_file) => {
expect(_file('app/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(fixture('util-test/default.js'));
});
});
- it('util foo-bar.js', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js'], _file => {
+ it('util foo-bar.js', function () {
+ return emberGenerateDestroy(['util', 'foo-bar.js'], (_file) => {
expect(_file('app/utils/foo-bar.js.js')).to.not.exist;
expect(_file('tests/unit/utils/foo-bar.js-test.js')).to.not.exist;
@@ -51,8 +47,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo/bar-baz', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz'], _file => {
+ it('util foo/bar-baz', function () {
+ return emberGenerateDestroy(['util', 'foo/bar-baz'], (_file) => {
expect(_file('app/utils/foo/bar-baz.js')).to.equal(fixture('util/util-nested.js'));
expect(_file('tests/unit/utils/foo/bar-baz-test.js')).to.equal(
@@ -61,16 +57,16 @@ describe('Blueprint: util', function() {
});
});
- it('util foo-bar --pod', function() {
- return emberGenerateDestroy(['util', 'foo-bar', '--pod'], _file => {
+ it('util foo-bar --pod', function () {
+ return emberGenerateDestroy(['util', 'foo-bar', '--pod'], (_file) => {
expect(_file('app/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(fixture('util-test/default.js'));
});
});
- it('util foo-bar.js --pod', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js', '--pod'], _file => {
+ it('util foo-bar.js --pod', function () {
+ return emberGenerateDestroy(['util', 'foo-bar.js', '--pod'], (_file) => {
expect(_file('app/utils/foo-bar.js.js')).to.not.exist;
expect(_file('tests/unit/utils/foo-bar.js-test.js')).to.not.exist;
@@ -80,8 +76,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo/bar-baz --pod', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz', '--pod'], _file => {
+ it('util foo/bar-baz --pod', function () {
+ return emberGenerateDestroy(['util', 'foo/bar-baz', '--pod'], (_file) => {
expect(_file('app/utils/foo/bar-baz.js')).to.equal(fixture('util/util-nested.js'));
expect(_file('tests/unit/utils/foo/bar-baz-test.js')).to.equal(
@@ -90,13 +86,13 @@ describe('Blueprint: util', function() {
});
});
- describe('with podModulePrefix', function() {
- beforeEach(function() {
+ describe('with podModulePrefix', function () {
+ beforeEach(function () {
return setupPodConfig({ podModulePrefix: true });
});
- it('util foo-bar --pod', function() {
- return emberGenerateDestroy(['util', 'foo-bar', '--pod'], _file => {
+ it('util foo-bar --pod', function () {
+ return emberGenerateDestroy(['util', 'foo-bar', '--pod'], (_file) => {
expect(_file('app/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(
@@ -105,8 +101,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo-bar.js --pod', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js', '--pod'], _file => {
+ it('util foo-bar.js --pod', function () {
+ return emberGenerateDestroy(['util', 'foo-bar.js', '--pod'], (_file) => {
expect(_file('app/utils/foo-bar.js.js')).to.not.exist;
expect(_file('tests/unit/utils/foo-bar.js-test.js')).to.not.exist;
@@ -120,59 +116,8 @@ describe('Blueprint: util', function() {
});
});
- describe('in app - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew()
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('util foo-bar', function() {
- return emberGenerateDestroy(['util', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
-
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/default.js'));
- });
- });
-
- it('util foo-bar.js', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js'], _file => {
- expect(_file('src/utils/foo-bar.js.js')).to.not.exist;
- expect(_file('src/utils/foo-bar.js-test.js')).to.not.exist;
-
- expect(_file('src/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
-
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/default.js'));
- });
- });
-
- it('util foo/bar-baz', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz'], _file => {
- expect(_file('src/utils/foo/bar-baz.js')).to.equal(fixture('util/util-nested.js'));
-
- expect(_file('src/utils/foo/bar-baz-test.js')).to.equal(
- fixture('util-test/default-nested.js')
- );
- });
- });
-
- it('util foo-bar --pod', function() {
- return expectError(
- emberGenerateDestroy(['util', 'foo-bar', '--pod']),
- "Pods aren't supported within a module unification app"
- );
- });
- });
-
- describe('in addon', function() {
- beforeEach(function() {
+ describe('in addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'addon' })
.then(() =>
modifyPackages([
@@ -183,8 +128,8 @@ describe('Blueprint: util', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('util foo-bar', function() {
- return emberGenerateDestroy(['util', 'foo-bar'], _file => {
+ it('util foo-bar', function () {
+ return emberGenerateDestroy(['util', 'foo-bar'], (_file) => {
expect(_file('addon/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
expect(_file('app/utils/foo-bar.js')).to.contain(
@@ -197,8 +142,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo-bar.js', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js'], _file => {
+ it('util foo-bar.js', function () {
+ return emberGenerateDestroy(['util', 'foo-bar.js'], (_file) => {
expect(_file('addon/utils/foo-bar.js.js')).to.not.exist;
expect(_file('app/utils/foo-bar.js.js')).to.not.exist;
expect(_file('tests/unit/utils/foo-bar.js-test.js')).to.not.exist;
@@ -215,8 +160,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo/bar-baz', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz'], _file => {
+ it('util foo/bar-baz', function () {
+ return emberGenerateDestroy(['util', 'foo/bar-baz'], (_file) => {
expect(_file('addon/utils/foo/bar-baz.js')).to.equal(fixture('util/util-nested.js'));
expect(_file('app/utils/foo/bar-baz.js')).to.contain(
@@ -229,8 +174,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo/bar-baz --dummy', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz', '--dummy'], _file => {
+ it('util foo/bar-baz --dummy', function () {
+ return emberGenerateDestroy(['util', 'foo/bar-baz', '--dummy'], (_file) => {
expect(_file('tests/dummy/app/utils/foo/bar-baz.js')).to.equal(
fixture('util/util-nested.js')
);
@@ -240,80 +185,8 @@ describe('Blueprint: util', function() {
});
});
- describe('in addon - module unification', function() {
- enableModuleUnification();
-
- beforeEach(function() {
- return emberNew({ target: 'addon' })
- .then(() =>
- modifyPackages([
- { name: 'ember-qunit', delete: true },
- { name: 'ember-cli-qunit', dev: true },
- ])
- )
- .then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
- });
-
- it('util foo-bar', function() {
- return emberGenerateDestroy(['util', 'foo-bar'], _file => {
- expect(_file('src/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
-
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/addon-default.js'));
-
- expect(_file('app/utils/foo-bar.js')).to.not.exist;
- });
- });
-
- it('util foo-bar.js', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js'], _file => {
- expect(_file('src/utils/foo-bar.js.js')).to.not.exist;
- expect(_file('src/utils/foo-bar.js-test.js')).to.not.exist;
-
- expect(_file('src/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
-
- expect(_file('src/utils/foo-bar-test.js')).to.equal(fixture('util-test/addon-default.js'));
-
- expect(_file('app/utils/foo-bar.js')).to.not.exist;
- });
- });
-
- it('util foo-bar/baz', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz'], _file => {
- expect(_file('src/utils/foo/bar-baz.js')).to.equal(fixture('util/util-nested.js'));
-
- expect(_file('src/utils/foo/bar-baz-test.js')).to.equal(
- fixture('util-test/addon-default-nested.js')
- );
-
- expect(_file('app/utils/foo/bar-baz.js')).to.not.exist;
- });
- });
-
- it('util foo/bar-baz --dummy', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz', '--dummy'], _file => {
- expect(_file('tests/dummy/src/utils/foo/bar-baz.js')).to.equal(
- fixture('util/util-nested.js')
- );
-
- expect(_file('src/utils/foo/bar-baz.js')).to.not.exist;
- });
- });
-
- it('util foo/bar-baz.js --dummy', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz.js', '--dummy'], _file => {
- expect(_file('tests/dummy/src/utils/foo/bar-baz.js.js')).to.not.exist;
-
- expect(_file('tests/dummy/src/utils/foo/bar-baz.js')).to.equal(
- fixture('util/util-nested.js')
- );
-
- expect(_file('src/utils/foo/bar-baz.js')).to.not.exist;
- });
- });
- });
-
- describe('in in-repo-addon', function() {
- beforeEach(function() {
+ describe('in in-repo-addon', function () {
+ beforeEach(function () {
return emberNew({ target: 'in-repo-addon' })
.then(() =>
modifyPackages([
@@ -324,8 +197,8 @@ describe('Blueprint: util', function() {
.then(() => generateFakePackageManifest('ember-cli-qunit', '4.1.0'));
});
- it('util foo-bar --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['util', 'foo-bar', '--in-repo-addon=my-addon'], _file => {
+ it('util foo-bar --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['util', 'foo-bar', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/utils/foo-bar.js')).to.equal(fixture('util/util.js'));
expect(_file('lib/my-addon/app/utils/foo-bar.js')).to.contain(
@@ -336,8 +209,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo-bar.js --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['util', 'foo-bar.js', '--in-repo-addon=my-addon'], _file => {
+ it('util foo-bar.js --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['util', 'foo-bar.js', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/utils/foo-bar.js.js')).to.not.exist;
expect(_file('lib/my-addon/app/utils/foo-bar.js.js')).to.not.exist;
expect(_file('tests/unit/utils/foo-bar.js-test.js')).to.not.exist;
@@ -352,8 +225,8 @@ describe('Blueprint: util', function() {
});
});
- it('util foo/bar-baz --in-repo-addon=my-addon', function() {
- return emberGenerateDestroy(['util', 'foo/bar-baz', '--in-repo-addon=my-addon'], _file => {
+ it('util foo/bar-baz --in-repo-addon=my-addon', function () {
+ return emberGenerateDestroy(['util', 'foo/bar-baz', '--in-repo-addon=my-addon'], (_file) => {
expect(_file('lib/my-addon/addon/utils/foo/bar-baz.js')).to.equal(
fixture('util/util-nested.js')
);
diff --git a/node-tests/fixtures/acceptance-test/addon-default.js b/node-tests/fixtures/acceptance-test/addon-default.js
index f8f352f2408..3ca96b784a0 100644
--- a/node-tests/fixtures/acceptance-test/addon-default.js
+++ b/node-tests/fixtures/acceptance-test/addon-default.js
@@ -3,10 +3,10 @@ import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | foo');
-test('visiting /foo', function(assert) {
+test('visiting /foo', function (assert) {
visit('/foo');
- andThen(function() {
- assert.equal(currentURL(), '/foo');
+ andThen(function () {
+ assert.strictEqual(currentURL(), '/foo');
});
});
diff --git a/node-tests/fixtures/acceptance-test/addon-nested.js b/node-tests/fixtures/acceptance-test/addon-nested.js
index ecba0d004bd..ccb4342836c 100644
--- a/node-tests/fixtures/acceptance-test/addon-nested.js
+++ b/node-tests/fixtures/acceptance-test/addon-nested.js
@@ -3,10 +3,10 @@ import moduleForAcceptance from '../../../tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | foo/bar');
-test('visiting /foo/bar', function(assert) {
+test('visiting /foo/bar', function (assert) {
visit('/foo/bar');
- andThen(function() {
- assert.equal(currentURL(), '/foo/bar');
+ andThen(function () {
+ assert.strictEqual(currentURL(), '/foo/bar');
});
});
diff --git a/node-tests/fixtures/acceptance-test/default.js b/node-tests/fixtures/acceptance-test/default.js
index e8fbc772d06..0662fdc1bc1 100644
--- a/node-tests/fixtures/acceptance-test/default.js
+++ b/node-tests/fixtures/acceptance-test/default.js
@@ -3,10 +3,10 @@ import moduleForAcceptance from 'my-app/tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | foo');
-test('visiting /foo', function(assert) {
+test('visiting /foo', function (assert) {
visit('/foo');
- andThen(function() {
- assert.equal(currentURL(), '/foo');
+ andThen(function () {
+ assert.strictEqual(currentURL(), '/foo');
});
});
diff --git a/node-tests/fixtures/acceptance-test/mocha-rfc268-addon.js b/node-tests/fixtures/acceptance-test/mocha-rfc268-addon.js
new file mode 100644
index 00000000000..e5779451abc
--- /dev/null
+++ b/node-tests/fixtures/acceptance-test/mocha-rfc268-addon.js
@@ -0,0 +1,13 @@
+import { describe, it } from 'mocha';
+import { expect } from 'chai';
+import { setupApplicationTest } from 'dummy/tests/helpers';
+import { visit, currentURL } from '@ember/test-helpers';
+
+describe('Acceptance | foo', function () {
+ setupApplicationTest();
+
+ it('can visit /foo', async function () {
+ await visit('/foo');
+ expect(currentURL()).to.equal('/foo');
+ });
+});
diff --git a/node-tests/fixtures/acceptance-test/mocha-rfc268.js b/node-tests/fixtures/acceptance-test/mocha-rfc268.js
index 9f5c93d21f1..89b9ee39e21 100644
--- a/node-tests/fixtures/acceptance-test/mocha-rfc268.js
+++ b/node-tests/fixtures/acceptance-test/mocha-rfc268.js
@@ -1,12 +1,12 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
-import { setupApplicationTest } from 'ember-mocha';
+import { setupApplicationTest } from 'my-app/tests/helpers';
import { visit, currentURL } from '@ember/test-helpers';
-describe('Acceptance | foo', function() {
+describe('Acceptance | foo', function () {
setupApplicationTest();
- it('can visit /foo', async function() {
+ it('can visit /foo', async function () {
await visit('/foo');
expect(currentURL()).to.equal('/foo');
});
diff --git a/node-tests/fixtures/acceptance-test/mocha.js b/node-tests/fixtures/acceptance-test/mocha.js
index b2a8f0b6171..bd30772492e 100644
--- a/node-tests/fixtures/acceptance-test/mocha.js
+++ b/node-tests/fixtures/acceptance-test/mocha.js
@@ -3,18 +3,18 @@ import { expect } from 'chai';
import startApp from 'my-app/tests/helpers/start-app';
import { run } from '@ember/runloop';
-describe('Acceptance | foo', function() {
+describe('Acceptance | foo', function () {
let application;
- beforeEach(function() {
+ beforeEach(function () {
application = startApp();
});
- afterEach(function() {
+ afterEach(function () {
run(application, 'destroy');
});
- it('can visit /foo', function() {
+ it('can visit /foo', function () {
visit('/foo');
return andThen(() => {
diff --git a/node-tests/fixtures/acceptance-test/qunit-rfc268-addon.js b/node-tests/fixtures/acceptance-test/qunit-rfc268-addon.js
new file mode 100644
index 00000000000..88e63811d12
--- /dev/null
+++ b/node-tests/fixtures/acceptance-test/qunit-rfc268-addon.js
@@ -0,0 +1,13 @@
+import { module, test } from 'qunit';
+import { visit, currentURL } from '@ember/test-helpers';
+import { setupApplicationTest } from 'dummy/tests/helpers';
+
+module('Acceptance | foo', function (hooks) {
+ setupApplicationTest(hooks);
+
+ test('visiting /foo', async function (assert) {
+ await visit('/foo');
+
+ assert.strictEqual(currentURL(), '/foo');
+ });
+});
diff --git a/node-tests/fixtures/acceptance-test/qunit-rfc268.js b/node-tests/fixtures/acceptance-test/qunit-rfc268.js
index 25eab4cf23b..a313e02d112 100644
--- a/node-tests/fixtures/acceptance-test/qunit-rfc268.js
+++ b/node-tests/fixtures/acceptance-test/qunit-rfc268.js
@@ -1,13 +1,13 @@
import { module, test } from 'qunit';
import { visit, currentURL } from '@ember/test-helpers';
-import { setupApplicationTest } from 'ember-qunit';
+import { setupApplicationTest } from 'my-app/tests/helpers';
-module('Acceptance | foo', function(hooks) {
+module('Acceptance | foo', function (hooks) {
setupApplicationTest(hooks);
- test('visiting /foo', async function(assert) {
+ test('visiting /foo', async function (assert) {
await visit('/foo');
- assert.equal(currentURL(), '/foo');
+ assert.strictEqual(currentURL(), '/foo');
});
});
diff --git a/node-tests/fixtures/component-test/default-template.js b/node-tests/fixtures/component-test/default-template.js
index 72df2c7ff6e..caf12d3460a 100644
--- a/node-tests/fixtures/component-test/default-template.js
+++ b/node-tests/fixtures/component-test/default-template.js
@@ -2,16 +2,16 @@ import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('<%= path =%><%= component =%>', 'Integration | Component | <%= component =%>', {
- integration: true
+ integration: true,
});
-test('it renders', function(assert) {
+test('it renders', function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs`<<%= componentInvocation =%> />`);
- assert.equal(this.$().text().trim(), '');
+ assert.strictEqual(this.$().text().trim(), '');
// Template block usage:
this.render(hbs`
@@ -20,5 +20,5 @@ test('it renders', function(assert) {
<%= componentInvocation =%>>
`);
- assert.equal(this.$().text().trim(), 'template block text');
+ assert.strictEqual(this.$().text().trim(), 'template block text');
});
diff --git a/node-tests/fixtures/component-test/default.js b/node-tests/fixtures/component-test/default.js
index fc4c11ce4b9..e3ac770ec05 100644
--- a/node-tests/fixtures/component-test/default.js
+++ b/node-tests/fixtures/component-test/default.js
@@ -2,16 +2,16 @@ import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('x-foo', 'Integration | Component | x-foo', {
- integration: true
+ integration: true,
});
-test('it renders', function(assert) {
+test('it renders', function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.render(hbs``);
- assert.equal(this.$().text().trim(), '');
+ assert.strictEqual(this.$().text().trim(), '');
// Template block usage:
this.render(hbs`
@@ -20,5 +20,5 @@ test('it renders', function(assert) {
`);
- assert.equal(this.$().text().trim(), 'template block text');
+ assert.strictEqual(this.$().text().trim(), 'template block text');
});
diff --git a/node-tests/fixtures/component-test/mocha-0.12-unit.js b/node-tests/fixtures/component-test/mocha-0.12-unit.js
index 05378537f6d..c98405285dd 100644
--- a/node-tests/fixtures/component-test/mocha-0.12-unit.js
+++ b/node-tests/fixtures/component-test/mocha-0.12-unit.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
-describe('Unit | Component | x-foo', function() {
+describe('Unit | Component | x-foo', function () {
setupComponentTest('x-foo', {
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true
+ unit: true,
});
- it('renders', function() {
+ it('renders', function () {
// creates the component instance
let component = this.subject();
// renders the component on the page
diff --git a/node-tests/fixtures/component-test/mocha-0.12.js b/node-tests/fixtures/component-test/mocha-0.12.js
index 2cc9ca48a18..d15179c6bd7 100644
--- a/node-tests/fixtures/component-test/mocha-0.12.js
+++ b/node-tests/fixtures/component-test/mocha-0.12.js
@@ -3,12 +3,12 @@ import { describe, it } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
-describe('Integration | Component | x-foo', function() {
+describe('Integration | Component | x-foo', function () {
setupComponentTest('x-foo', {
- integration: true
+ integration: true,
});
- it('renders', function() {
+ it('renders', function () {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
diff --git a/node-tests/fixtures/component-test/mocha-rfc232-addon.js b/node-tests/fixtures/component-test/mocha-rfc232-addon.js
new file mode 100644
index 00000000000..0424b8f4429
--- /dev/null
+++ b/node-tests/fixtures/component-test/mocha-rfc232-addon.js
@@ -0,0 +1,27 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from 'dummy/tests/helpers';
+import { render } from '@ember/test-helpers';
+import hbs from 'htmlbars-inline-precompile';
+
+describe('Integration | Component | foo', function () {
+ setupRenderingTest();
+
+ it('renders', async function () {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs``);
+
+ expect(this.element.textContent.trim()).to.equal('');
+
+ // Template block usage:
+ await render(hbs`
+
+ template block text
+
+ `);
+
+ expect(this.element.textContent.trim()).to.equal('template block text');
+ });
+});
diff --git a/node-tests/fixtures/component-test/mocha-rfc232-unit-addon.js b/node-tests/fixtures/component-test/mocha-rfc232-unit-addon.js
new file mode 100644
index 00000000000..6e0e48fb188
--- /dev/null
+++ b/node-tests/fixtures/component-test/mocha-rfc232-unit-addon.js
@@ -0,0 +1,12 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'dummy/tests/helpers';
+
+describe('Unit | Component | foo', function () {
+ setupTest();
+
+ it('exists', function () {
+ let component = this.owner.factoryFor('component:foo').create();
+ expect(component).to.be.ok;
+ });
+});
diff --git a/node-tests/fixtures/component-test/mocha-rfc232-unit.js b/node-tests/fixtures/component-test/mocha-rfc232-unit.js
index 72f1b87eb6d..bd084d11c77 100644
--- a/node-tests/fixtures/component-test/mocha-rfc232-unit.js
+++ b/node-tests/fixtures/component-test/mocha-rfc232-unit.js
@@ -1,11 +1,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
+import { setupTest } from 'my-app/tests/helpers';
-describe('Unit | Component | x-foo', function() {
+describe('Unit | Component | x-foo', function () {
setupTest();
- it('exists', function() {
+ it('exists', function () {
let component = this.owner.factoryFor('component:x-foo').create();
expect(component).to.be.ok;
});
diff --git a/node-tests/fixtures/component-test/mocha-rfc232.js b/node-tests/fixtures/component-test/mocha-rfc232.js
index 377c35ea122..8f1edf3f246 100644
--- a/node-tests/fixtures/component-test/mocha-rfc232.js
+++ b/node-tests/fixtures/component-test/mocha-rfc232.js
@@ -1,13 +1,13 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupRenderingTest } from 'ember-mocha';
+import { setupRenderingTest } from 'my-app/tests/helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
-describe('Integration | Component | x-foo', function() {
+describe('Integration | Component | x-foo', function () {
setupRenderingTest();
- it('renders', async function() {
+ it('renders', async function () {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
diff --git a/node-tests/fixtures/component-test/mocha-unit.js b/node-tests/fixtures/component-test/mocha-unit.js
index b5aeb40d2aa..8a39bb4fbac 100644
--- a/node-tests/fixtures/component-test/mocha-unit.js
+++ b/node-tests/fixtures/component-test/mocha-unit.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeComponent, it } from 'ember-mocha';
-describeComponent('x-foo', 'Unit | Component | x-foo',
+describeComponent(
+ 'x-foo',
+ 'Unit | Component | x-foo',
{
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true
+ unit: true,
},
- function() {
- it('renders', function() {
+ function () {
+ it('renders', function () {
// creates the component instance
let component = this.subject();
// renders the component on the page
diff --git a/node-tests/fixtures/component-test/mocha.js b/node-tests/fixtures/component-test/mocha.js
index 0d81e511bb2..c2d3a7f7355 100644
--- a/node-tests/fixtures/component-test/mocha.js
+++ b/node-tests/fixtures/component-test/mocha.js
@@ -2,12 +2,14 @@ import { expect } from 'chai';
import { describeComponent, it } from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
-describeComponent('x-foo', 'Integration | Component | x-foo',
+describeComponent(
+ 'x-foo',
+ 'Integration | Component | x-foo',
{
- integration: true
+ integration: true,
},
- function() {
- it('renders', function() {
+ function () {
+ it('renders', function () {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
diff --git a/node-tests/fixtures/component-test/rfc232-addon.js b/node-tests/fixtures/component-test/rfc232-addon.js
new file mode 100644
index 00000000000..0c22851c05a
--- /dev/null
+++ b/node-tests/fixtures/component-test/rfc232-addon.js
@@ -0,0 +1,26 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'dummy/tests/helpers';
+import { render } from '@ember/test-helpers';
+import hbs from 'htmlbars-inline-precompile';
+
+module('Integration | Component | foo', function (hooks) {
+ setupRenderingTest(hooks);
+
+ test('it renders', async function (assert) {
+ // Set any properties with this.set('myProperty', 'value');
+ // Handle any actions with this.set('myAction', function(val) { ... });
+
+ await render(hbs``);
+
+ assert.dom(this.element).hasText('');
+
+ // Template block usage:
+ await render(hbs`
+
+ template block text
+
+ `);
+
+ assert.dom(this.element).hasText('template block text');
+ });
+});
diff --git a/node-tests/fixtures/component-test/rfc232-unit-addon.js b/node-tests/fixtures/component-test/rfc232-unit-addon.js
new file mode 100644
index 00000000000..818671c1285
--- /dev/null
+++ b/node-tests/fixtures/component-test/rfc232-unit-addon.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'dummy/tests/helpers';
+
+module('Unit | Component | foo', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let component = this.owner.factoryFor('component:foo').create();
+ assert.ok(component);
+ });
+});
diff --git a/node-tests/fixtures/component-test/rfc232-unit.js b/node-tests/fixtures/component-test/rfc232-unit.js
index 8aa1687366b..404bf3f9409 100644
--- a/node-tests/fixtures/component-test/rfc232-unit.js
+++ b/node-tests/fixtures/component-test/rfc232-unit.js
@@ -1,10 +1,10 @@
import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
+import { setupTest } from 'my-app/tests/helpers';
-module('Unit | Component | x-foo', function(hooks) {
+module('Unit | Component | x-foo', function (hooks) {
setupTest(hooks);
- test('it exists', function(assert) {
+ test('it exists', function (assert) {
let component = this.owner.factoryFor('component:x-foo').create();
assert.ok(component);
});
diff --git a/node-tests/fixtures/component-test/rfc232.js b/node-tests/fixtures/component-test/rfc232.js
index cfb910ec002..93374f79530 100644
--- a/node-tests/fixtures/component-test/rfc232.js
+++ b/node-tests/fixtures/component-test/rfc232.js
@@ -1,18 +1,18 @@
import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
+import { setupRenderingTest } from 'my-app/tests/helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
-module('Integration | Component | x-foo', function(hooks) {
+module('Integration | Component | x-foo', function (hooks) {
setupRenderingTest(hooks);
- test('it renders', async function(assert) {
+ test('it renders', async function (assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs``);
- assert.equal(this.element.textContent.trim(), '');
+ assert.dom(this.element).hasText('');
// Template block usage:
await render(hbs`
@@ -21,6 +21,6 @@ module('Integration | Component | x-foo', function(hooks) {
`);
- assert.equal(this.element.textContent.trim(), 'template block text');
+ assert.dom(this.element).hasText('template block text');
});
});
diff --git a/node-tests/fixtures/component-test/unit.js b/node-tests/fixtures/component-test/unit.js
index 74bc9dcb53d..e0315a88335 100644
--- a/node-tests/fixtures/component-test/unit.js
+++ b/node-tests/fixtures/component-test/unit.js
@@ -3,14 +3,13 @@ import { moduleForComponent, test } from 'ember-qunit';
moduleForComponent('x-foo', 'Unit | Component | x-foo', {
// Specify the other units that are required for this test
// needs: ['component:foo', 'helper:bar'],
- unit: true
+ unit: true,
});
-test('it renders', function(assert) {
-
+test('it renders', function (assert) {
// Creates the component instance
/*let component =*/ this.subject();
// Renders the component to the page
this.render();
- assert.equal(this.$().text().trim(), '');
+ assert.strictEqual(this.$().text().trim(), '');
});
diff --git a/node-tests/fixtures/component/component-addon-dash-pod.js b/node-tests/fixtures/component/component-addon-dash-pod.js
deleted file mode 100644
index ab273cde100..00000000000
--- a/node-tests/fixtures/component/component-addon-dash-pod.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Component from '@ember/component';
-import layout from './template';
-
-export default Component.extend({
- layout
-});
diff --git a/node-tests/fixtures/component/component-addon-dash.js b/node-tests/fixtures/component/component-addon-dash.js
deleted file mode 100644
index 48554d4c235..00000000000
--- a/node-tests/fixtures/component/component-addon-dash.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Component from '@ember/component';
-import layout from '../templates/components/x-foo';
-
-export default Component.extend({
- layout
-});
diff --git a/node-tests/fixtures/component/component-addon-nested-pod.js b/node-tests/fixtures/component/component-addon-nested-pod.js
deleted file mode 100644
index ab273cde100..00000000000
--- a/node-tests/fixtures/component/component-addon-nested-pod.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Component from '@ember/component';
-import layout from './template';
-
-export default Component.extend({
- layout
-});
diff --git a/node-tests/fixtures/component/component-addon-nested.js b/node-tests/fixtures/component/component-addon-nested.js
deleted file mode 100644
index a82bb87775a..00000000000
--- a/node-tests/fixtures/component/component-addon-nested.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Component from '@ember/component';
-import layout from '../../templates/components/foo/x-foo';
-
-export default Component.extend({
- layout
-});
diff --git a/node-tests/fixtures/component/component-addon.js b/node-tests/fixtures/component/component-addon.js
deleted file mode 100644
index e1a8431527e..00000000000
--- a/node-tests/fixtures/component/component-addon.js
+++ /dev/null
@@ -1,6 +0,0 @@
-import Component from '@ember/component';
-import layout from '../templates/components/foo';
-
-export default Component.extend({
- layout
-});
diff --git a/node-tests/fixtures/component/component-dash.js b/node-tests/fixtures/component/component-dash.js
index bb93d73f350..77fcff7ef89 100644
--- a/node-tests/fixtures/component/component-dash.js
+++ b/node-tests/fixtures/component/component-dash.js
@@ -1,4 +1,3 @@
-import Component from '@ember/component';
+import Component from '@glimmer/component';
-export default Component.extend({
-});
+export default class XFooComponent extends Component {}
diff --git a/node-tests/fixtures/component/component-nested.js b/node-tests/fixtures/component/component-nested.js
index bb93d73f350..b1da76d57d4 100644
--- a/node-tests/fixtures/component/component-nested.js
+++ b/node-tests/fixtures/component/component-nested.js
@@ -1,4 +1,3 @@
-import Component from '@ember/component';
+import Component from '@glimmer/component';
-export default Component.extend({
-});
+export default class FooXFooComponent extends Component {}
diff --git a/node-tests/fixtures/component/component.js b/node-tests/fixtures/component/component.js
index bb93d73f350..5663784b5d5 100644
--- a/node-tests/fixtures/component/component.js
+++ b/node-tests/fixtures/component/component.js
@@ -1,4 +1,3 @@
-import Component from '@ember/component';
+import Component from '@glimmer/component';
-export default Component.extend({
-});
+export default class FooComponent extends Component {}
diff --git a/node-tests/fixtures/component/native-component-dash.js b/node-tests/fixtures/component/native-component-dash.js
deleted file mode 100644
index 9e23a7c24fc..00000000000
--- a/node-tests/fixtures/component/native-component-dash.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Component from '@glimmer/component';
-
-export default class XFooComponent extends Component {
-}
diff --git a/node-tests/fixtures/component/native-component-nested.js b/node-tests/fixtures/component/native-component-nested.js
deleted file mode 100644
index 4894221b299..00000000000
--- a/node-tests/fixtures/component/native-component-nested.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Component from '@glimmer/component';
-
-export default class FooXFooComponent extends Component {
-}
diff --git a/node-tests/fixtures/component/native-component.js b/node-tests/fixtures/component/native-component.js
deleted file mode 100644
index ae749fcda9b..00000000000
--- a/node-tests/fixtures/component/native-component.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Component from '@glimmer/component';
-
-export default class FooComponent extends Component {
-}
diff --git a/node-tests/fixtures/controller-test/default-nested.js b/node-tests/fixtures/controller-test/default-nested.js
index 8775fe7aefa..d7ee67d9bf4 100644
--- a/node-tests/fixtures/controller-test/default-nested.js
+++ b/node-tests/fixtures/controller-test/default-nested.js
@@ -6,7 +6,7 @@ moduleFor('controller:foo/bar', 'Unit | Controller | foo/bar', {
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let controller = this.subject();
assert.ok(controller);
});
diff --git a/node-tests/fixtures/controller-test/default.js b/node-tests/fixtures/controller-test/default.js
index 97d30048db1..ce293abaebd 100644
--- a/node-tests/fixtures/controller-test/default.js
+++ b/node-tests/fixtures/controller-test/default.js
@@ -6,7 +6,7 @@ moduleFor('controller:foo', 'Unit | Controller | foo', {
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let controller = this.subject();
assert.ok(controller);
});
diff --git a/node-tests/fixtures/controller-test/mocha-0.12-nested.js b/node-tests/fixtures/controller-test/mocha-0.12-nested.js
index 57b82b4f136..0b33f570ed9 100644
--- a/node-tests/fixtures/controller-test/mocha-0.12-nested.js
+++ b/node-tests/fixtures/controller-test/mocha-0.12-nested.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('Unit | Controller | foo/bar', function() {
+describe('Unit | Controller | foo/bar', function () {
setupTest('controller:foo/bar', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/mocha-0.12.js b/node-tests/fixtures/controller-test/mocha-0.12.js
index eb39fcd92be..44d665349bd 100644
--- a/node-tests/fixtures/controller-test/mocha-0.12.js
+++ b/node-tests/fixtures/controller-test/mocha-0.12.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('Unit | Controller | foo', function() {
+describe('Unit | Controller | foo', function () {
setupTest('controller:foo', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/mocha-nested.js b/node-tests/fixtures/controller-test/mocha-nested.js
index 8e3a62027b1..0810b155690 100644
--- a/node-tests/fixtures/controller-test/mocha-nested.js
+++ b/node-tests/fixtures/controller-test/mocha-nested.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('controller:foo/bar', 'Unit | Controller | foo/bar',
+describeModule(
+ 'controller:foo/bar',
+ 'Unit | Controller | foo/bar',
{
// Specify the other units that are required for this test.
// needs: ['controller:foo']
},
- function() {
+ function () {
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/mocha-rfc232-addon.js b/node-tests/fixtures/controller-test/mocha-rfc232-addon.js
new file mode 100644
index 00000000000..013290ac0f4
--- /dev/null
+++ b/node-tests/fixtures/controller-test/mocha-rfc232-addon.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'dummy/tests/helpers';
+
+describe('Unit | Controller | foo', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let controller = this.owner.lookup('controller:foo');
+ expect(controller).to.be.ok;
+ });
+});
diff --git a/node-tests/fixtures/controller-test/mocha-rfc232-nested.js b/node-tests/fixtures/controller-test/mocha-rfc232-nested.js
index addbae8ee7d..0eee2a68ef3 100644
--- a/node-tests/fixtures/controller-test/mocha-rfc232-nested.js
+++ b/node-tests/fixtures/controller-test/mocha-rfc232-nested.js
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
+import { setupTest } from 'my-app/tests/helpers';
-describe('Unit | Controller | foo/bar', function() {
+describe('Unit | Controller | foo/bar', function () {
setupTest();
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.owner.lookup('controller:foo/bar');
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/mocha-rfc232.js b/node-tests/fixtures/controller-test/mocha-rfc232.js
index b21b4dadb5b..b0a2c780a73 100644
--- a/node-tests/fixtures/controller-test/mocha-rfc232.js
+++ b/node-tests/fixtures/controller-test/mocha-rfc232.js
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
+import { setupTest } from 'my-app/tests/helpers';
-describe('Unit | Controller | foo', function() {
+describe('Unit | Controller | foo', function () {
setupTest();
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.owner.lookup('controller:foo');
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/mocha.js b/node-tests/fixtures/controller-test/mocha.js
index 2ab57c0d820..989643d1552 100644
--- a/node-tests/fixtures/controller-test/mocha.js
+++ b/node-tests/fixtures/controller-test/mocha.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('controller:foo', 'Unit | Controller | foo',
+describeModule(
+ 'controller:foo',
+ 'Unit | Controller | foo',
{
// Specify the other units that are required for this test.
// needs: ['controller:foo']
},
- function() {
+ function () {
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let controller = this.subject();
expect(controller).to.be.ok;
});
diff --git a/node-tests/fixtures/controller-test/rfc232-addon.js b/node-tests/fixtures/controller-test/rfc232-addon.js
new file mode 100644
index 00000000000..ca8a7adc375
--- /dev/null
+++ b/node-tests/fixtures/controller-test/rfc232-addon.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'dummy/tests/helpers';
+
+module('Unit | Controller | foo', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let controller = this.owner.lookup('controller:foo');
+ assert.ok(controller);
+ });
+});
diff --git a/node-tests/fixtures/controller-test/rfc232-nested.js b/node-tests/fixtures/controller-test/rfc232-nested.js
index a4b9f1b4ec4..598a6942a42 100644
--- a/node-tests/fixtures/controller-test/rfc232-nested.js
+++ b/node-tests/fixtures/controller-test/rfc232-nested.js
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
+import { setupTest } from 'my-app/tests/helpers';
-module('Unit | Controller | foo/bar', function(hooks) {
+module('Unit | Controller | foo/bar', function (hooks) {
setupTest(hooks);
// TODO: Replace this with your real tests.
- test('it exists', function(assert) {
+ test('it exists', function (assert) {
let controller = this.owner.lookup('controller:foo/bar');
assert.ok(controller);
});
diff --git a/node-tests/fixtures/controller-test/rfc232.js b/node-tests/fixtures/controller-test/rfc232.js
index 7b7fce3846e..44f3af0265f 100644
--- a/node-tests/fixtures/controller-test/rfc232.js
+++ b/node-tests/fixtures/controller-test/rfc232.js
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
+import { setupTest } from 'my-app/tests/helpers';
-module('Unit | Controller | foo', function(hooks) {
+module('Unit | Controller | foo', function (hooks) {
setupTest(hooks);
// TODO: Replace this with your real tests.
- test('it exists', function(assert) {
+ test('it exists', function (assert) {
let controller = this.owner.lookup('controller:foo');
assert.ok(controller);
});
diff --git a/node-tests/fixtures/controller/controller-nested.js b/node-tests/fixtures/controller/controller-nested.js
index d630f313455..1d43f2f7b51 100644
--- a/node-tests/fixtures/controller/controller-nested.js
+++ b/node-tests/fixtures/controller/controller-nested.js
@@ -1,4 +1,3 @@
import Controller from '@ember/controller';
-export default Controller.extend({
-});
+export default class FooBarController extends Controller {}
diff --git a/node-tests/fixtures/controller/controller.js b/node-tests/fixtures/controller/controller.js
index d630f313455..e62a7ed792d 100644
--- a/node-tests/fixtures/controller/controller.js
+++ b/node-tests/fixtures/controller/controller.js
@@ -1,4 +1,3 @@
import Controller from '@ember/controller';
-export default Controller.extend({
-});
+export default class FooController extends Controller {}
diff --git a/node-tests/fixtures/controller/native-controller-nested.js b/node-tests/fixtures/controller/native-controller-nested.js
deleted file mode 100644
index 2461fdcd5cb..00000000000
--- a/node-tests/fixtures/controller/native-controller-nested.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Controller from '@ember/controller';
-
-export default class FooBarController extends Controller {
-}
diff --git a/node-tests/fixtures/controller/native-controller.js b/node-tests/fixtures/controller/native-controller.js
deleted file mode 100644
index 987a05b3be6..00000000000
--- a/node-tests/fixtures/controller/native-controller.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Controller from '@ember/controller';
-
-export default class FooController extends Controller {
-}
diff --git a/node-tests/fixtures/helper-test/integration.js b/node-tests/fixtures/helper-test/integration.js
index ad4f7e3782b..232b3af1558 100644
--- a/node-tests/fixtures/helper-test/integration.js
+++ b/node-tests/fixtures/helper-test/integration.js
@@ -2,14 +2,14 @@ import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {
- integration: true
+ integration: true,
});
// TODO: Replace this with your real tests.
-test('it renders', function(assert) {
+test('it renders', function (assert) {
this.set('inputValue', '1234');
- this.render(hbs`{{foo/bar-baz inputValue}}`);
+ this.render(hbs`{{foo/bar-baz this.inputValue}}`);
- assert.equal(this.$().text().trim(), '1234');
+ assert.strictEqual(this.$().text().trim(), '1234');
});
diff --git a/node-tests/fixtures/helper-test/mocha-0.12-unit.js b/node-tests/fixtures/helper-test/mocha-0.12-unit.js
deleted file mode 100644
index bcce8c2c865..00000000000
--- a/node-tests/fixtures/helper-test/mocha-0.12-unit.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';
-
-describe('Unit | Helper | foo/bar-baz', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = fooBarBaz(42);
- expect(result).to.be.ok;
- });
-});
-
diff --git a/node-tests/fixtures/helper-test/mocha-0.12.js b/node-tests/fixtures/helper-test/mocha-0.12.js
index d2eb4578af0..64d1bca53c9 100644
--- a/node-tests/fixtures/helper-test/mocha-0.12.js
+++ b/node-tests/fixtures/helper-test/mocha-0.12.js
@@ -3,12 +3,12 @@ import { describe, it } from 'mocha';
import { setupComponentTest } from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
-describe('Integration | Helper | foo/bar-baz', function() {
+describe('Integration | Helper | foo/bar-baz', function () {
setupComponentTest('foo/bar-baz', {
- integration: true
+ integration: true,
});
- it('renders', function() {
+ it('renders', function () {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
@@ -19,9 +19,8 @@ describe('Integration | Helper | foo/bar-baz', function() {
// `);
this.set('inputValue', '1234');
- this.render(hbs`{{foo/bar-baz inputValue}}`);
+ this.render(hbs`{{foo/bar-baz this.inputValue}}`);
expect(this.$().text().trim()).to.equal('1234');
});
});
-
diff --git a/node-tests/fixtures/helper-test/mocha-rfc232-addon.js b/node-tests/fixtures/helper-test/mocha-rfc232-addon.js
new file mode 100644
index 00000000000..2b52c2cb647
--- /dev/null
+++ b/node-tests/fixtures/helper-test/mocha-rfc232-addon.js
@@ -0,0 +1,18 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupRenderingTest } from 'dummy/tests/helpers';
+import { render } from '@ember/test-helpers';
+import hbs from 'htmlbars-inline-precompile';
+
+describe('Integration | Helper | foo', function () {
+ setupRenderingTest();
+
+ // TODO: Replace this with your real tests.
+ it('renders', async function () {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{foo this.inputValue}}`);
+
+ expect(this.element.textContent.trim()).to.equal('1234');
+ });
+});
diff --git a/node-tests/fixtures/helper-test/mocha-rfc232-unit.js b/node-tests/fixtures/helper-test/mocha-rfc232-unit.js
deleted file mode 100644
index f19b35a93f7..00000000000
--- a/node-tests/fixtures/helper-test/mocha-rfc232-unit.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';
-
-describe('Unit | Helper | foo/bar-baz', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = fooBarBaz(42);
- expect(result).to.be.ok;
- });
-});
diff --git a/node-tests/fixtures/helper-test/mocha-rfc232.js b/node-tests/fixtures/helper-test/mocha-rfc232.js
index 9944e574437..8b262c88ff2 100644
--- a/node-tests/fixtures/helper-test/mocha-rfc232.js
+++ b/node-tests/fixtures/helper-test/mocha-rfc232.js
@@ -1,17 +1,17 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupRenderingTest } from 'ember-mocha';
+import { setupRenderingTest } from 'my-app/tests/helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
-describe('Integration | Helper | foo/bar-baz', function() {
+describe('Integration | Helper | foo/bar-baz', function () {
setupRenderingTest();
// TODO: Replace this with your real tests.
- it('renders', async function() {
+ it('renders', async function () {
this.set('inputValue', '1234');
- await render(hbs`{{foo/bar-baz inputValue}}`);
+ await render(hbs`{{foo/bar-baz this.inputValue}}`);
expect(this.element.textContent.trim()).to.equal('1234');
});
diff --git a/node-tests/fixtures/helper-test/mocha-unit.js b/node-tests/fixtures/helper-test/mocha-unit.js
deleted file mode 100644
index bcce8c2c865..00000000000
--- a/node-tests/fixtures/helper-test/mocha-unit.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { expect } from 'chai';
-import { describe, it } from 'mocha';
-import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';
-
-describe('Unit | Helper | foo/bar-baz', function() {
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- let result = fooBarBaz(42);
- expect(result).to.be.ok;
- });
-});
-
diff --git a/node-tests/fixtures/helper-test/mocha.js b/node-tests/fixtures/helper-test/mocha.js
index bece512a42d..dd93cd84e46 100644
--- a/node-tests/fixtures/helper-test/mocha.js
+++ b/node-tests/fixtures/helper-test/mocha.js
@@ -1,14 +1,15 @@
import { expect } from 'chai';
-
import { describeComponent, it } from 'ember-mocha';
import hbs from 'htmlbars-inline-precompile';
-describeComponent('foo/bar-baz', 'helper:foo/bar-baz',
+describeComponent(
+ 'foo/bar-baz',
+ 'helper:foo/bar-baz',
{
- integration: true
+ integration: true,
},
- function() {
- it('renders', function() {
+ function () {
+ it('renders', function () {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
@@ -19,10 +20,9 @@ describeComponent('foo/bar-baz', 'helper:foo/bar-baz',
// `);
this.set('inputValue', '1234');
- this.render(hbs`{{foo/bar-baz inputValue}}`);
+ this.render(hbs`{{foo/bar-baz this.inputValue}}`);
expect(this.$().text().trim()).to.equal('1234');
});
}
);
-
diff --git a/node-tests/fixtures/helper-test/module-unification/addon-unit.js b/node-tests/fixtures/helper-test/module-unification/addon-unit.js
deleted file mode 100644
index d38c3e2629c..00000000000
--- a/node-tests/fixtures/helper-test/module-unification/addon-unit.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-import { fooBarBaz } from 'my-addon/helpers/foo/bar-baz';
-import { module, test } from 'qunit';
-
-module('Unit | Helper | foo/bar-baz');
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- let result = fooBarBaz([42]);
- assert.ok(result);
-});
-
diff --git a/node-tests/fixtures/helper-test/rfc232-addon.js b/node-tests/fixtures/helper-test/rfc232-addon.js
new file mode 100644
index 00000000000..af309a80c63
--- /dev/null
+++ b/node-tests/fixtures/helper-test/rfc232-addon.js
@@ -0,0 +1,17 @@
+import { module, test } from 'qunit';
+import { setupRenderingTest } from 'dummy/tests/helpers';
+import { render } from '@ember/test-helpers';
+import hbs from 'htmlbars-inline-precompile';
+
+module('Integration | Helper | foo', function (hooks) {
+ setupRenderingTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it renders', async function (assert) {
+ this.set('inputValue', '1234');
+
+ await render(hbs`{{foo this.inputValue}}`);
+
+ assert.dom(this.element).hasText('1234');
+ });
+});
diff --git a/node-tests/fixtures/helper-test/rfc232-unit.js b/node-tests/fixtures/helper-test/rfc232-unit.js
deleted file mode 100644
index fc08ea09909..00000000000
--- a/node-tests/fixtures/helper-test/rfc232-unit.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';
-import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
-
-module('Unit | Helper | foo/bar-baz', function(hooks) {
- setupTest(hooks);
-
- // TODO: Replace this with your real tests.
- test('it works', function(assert) {
- let result = fooBarBaz([42]);
- assert.ok(result);
- });
-});
diff --git a/node-tests/fixtures/helper-test/rfc232.js b/node-tests/fixtures/helper-test/rfc232.js
index d3c10cc68a6..ad840ae1ad5 100644
--- a/node-tests/fixtures/helper-test/rfc232.js
+++ b/node-tests/fixtures/helper-test/rfc232.js
@@ -1,17 +1,17 @@
import { module, test } from 'qunit';
-import { setupRenderingTest } from 'ember-qunit';
+import { setupRenderingTest } from 'my-app/tests/helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
-module('Integration | Helper | foo/bar-baz', function(hooks) {
+module('Integration | Helper | foo/bar-baz', function (hooks) {
setupRenderingTest(hooks);
// TODO: Replace this with your real tests.
- test('it renders', async function(assert) {
+ test('it renders', async function (assert) {
this.set('inputValue', '1234');
- await render(hbs`{{foo/bar-baz inputValue}}`);
+ await render(hbs`{{foo/bar-baz this.inputValue}}`);
- assert.equal(this.element.textContent.trim(), '1234');
+ assert.dom(this.element).hasText('1234');
});
});
diff --git a/node-tests/fixtures/helper-test/unit.js b/node-tests/fixtures/helper-test/unit.js
deleted file mode 100644
index 21a56367d22..00000000000
--- a/node-tests/fixtures/helper-test/unit.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';
-import { module, test } from 'qunit';
-
-module('Unit | Helper | foo/bar-baz');
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- let result = fooBarBaz([42]);
- assert.ok(result);
-});
-
diff --git a/node-tests/fixtures/helper/helper-addon.js b/node-tests/fixtures/helper/helper-addon.js
index 0d7257ad656..59f5ca352ea 100644
--- a/node-tests/fixtures/helper/helper-addon.js
+++ b/node-tests/fixtures/helper/helper-addon.js
@@ -1 +1 @@
-export { default, fooBarBaz } from 'my-addon/helpers/foo/bar-baz';
+export { default } from 'my-addon/helpers/foo/bar-baz';
diff --git a/node-tests/fixtures/helper/helper.js b/node-tests/fixtures/helper/helper.js
index 9d72f6faf61..f9ba5222510 100644
--- a/node-tests/fixtures/helper/helper.js
+++ b/node-tests/fixtures/helper/helper.js
@@ -1,5 +1,5 @@
import { helper } from '@ember/component/helper';
-export default helper(function fooBarBaz(params/*, hash*/) {
- return params;
+export default helper(function fooBarBaz(positional /*, named*/) {
+ return positional;
});
diff --git a/node-tests/fixtures/helper/mu-helper.js b/node-tests/fixtures/helper/mu-helper.js
index 316750779c1..88c8894ebd3 100644
--- a/node-tests/fixtures/helper/mu-helper.js
+++ b/node-tests/fixtures/helper/mu-helper.js
@@ -1,7 +1,7 @@
import { helper as buildHelper } from '@ember/component/helper';
-export function fooBarBaz(params/*, hash*/) {
- return params;
+export function fooBarBaz(positional /*, named*/) {
+ return positional;
}
export const helper = buildHelper(fooBarBaz);
diff --git a/node-tests/fixtures/initializer-test/default.js b/node-tests/fixtures/initializer-test/default.js
index 29ab5d4ef1c..3cc5b0c3db0 100644
--- a/node-tests/fixtures/initializer-test/default.js
+++ b/node-tests/fixtures/initializer-test/default.js
@@ -4,7 +4,6 @@ import { run } from '@ember/runloop';
import { initialize } from 'my-app/initializers/foo';
import { module, test } from 'qunit';
-
module('Unit | Initializer | foo', {
beforeEach() {
run(() => {
@@ -14,11 +13,11 @@ module('Unit | Initializer | foo', {
},
afterEach() {
run(this.application, 'destroy');
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.application);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/initializer-test/dummy.js b/node-tests/fixtures/initializer-test/dummy.js
index b48e96cece5..4ef19373903 100644
--- a/node-tests/fixtures/initializer-test/dummy.js
+++ b/node-tests/fixtures/initializer-test/dummy.js
@@ -4,7 +4,6 @@ import { run } from '@ember/runloop';
import { initialize } from 'dummy/initializers/foo';
import { module, test } from 'qunit';
-
module('Unit | Initializer | foo', {
beforeEach() {
run(() => {
@@ -14,11 +13,11 @@ module('Unit | Initializer | foo', {
},
afterEach() {
run(this.application, 'destroy');
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.application);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/initializer-test/mocha-rfc232.js b/node-tests/fixtures/initializer-test/mocha-rfc232.js
index ee2a5fb026d..d1492020e19 100644
--- a/node-tests/fixtures/initializer-test/mocha-rfc232.js
+++ b/node-tests/fixtures/initializer-test/mocha-rfc232.js
@@ -4,23 +4,25 @@ import Application from '@ember/application';
import { initialize } from 'my-app/initializers/foo';
import { run } from '@ember/runloop';
-describe('Unit | Initializer | foo', function() {
- beforeEach(function() {
+describe('Unit | Initializer | foo', function () {
+ beforeEach(function () {
this.TestApplication = Application.extend();
this.TestApplication.initializer({
name: 'initializer under test',
- initialize
+ initialize,
});
- this.application = this.TestApplication.create({ autoboot: false });
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
});
- afterEach(function() {
+ afterEach(function () {
run(this.application, 'destroy');
});
// TODO: Replace this with your real tests.
- it('works', async function() {
+ it('works', async function () {
await this.application.boot();
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/initializer-test/mocha.js b/node-tests/fixtures/initializer-test/mocha.js
index a59442cc5ef..242f7e91388 100644
--- a/node-tests/fixtures/initializer-test/mocha.js
+++ b/node-tests/fixtures/initializer-test/mocha.js
@@ -4,23 +4,22 @@ import { run } from '@ember/runloop';
import Application from '@ember/application';
import { initialize } from 'my-app/initializers/foo';
-
-describe('Unit | Initializer | foo', function() {
+describe('Unit | Initializer | foo', function () {
let application;
- beforeEach(function() {
- run(function() {
+ beforeEach(function () {
+ run(function () {
application = Application.create();
application.deferReadiness();
});
});
- afterEach(function() {
+ afterEach(function () {
run(application, 'destroy');
});
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
initialize(application);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/initializer-test/module-unification/default.js b/node-tests/fixtures/initializer-test/module-unification/default.js
deleted file mode 100644
index 24cbe31ebe0..00000000000
--- a/node-tests/fixtures/initializer-test/module-unification/default.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import Application from '@ember/application';
-import { run } from '@ember/runloop';
-
-import { initialize } from 'my-app/init/initializers/foo';
-import { module, test } from 'qunit';
-
-
-module('Unit | Initializer | foo', {
- beforeEach() {
- run(() => {
- this.application = Application.create();
- this.application.deferReadiness();
- });
- },
- afterEach() {
- run(this.application, 'destroy');
- }
-});
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- initialize(this.application);
-
- // you would normally confirm the results of the initializer here
- assert.ok(true);
-});
diff --git a/node-tests/fixtures/initializer-test/module-unification/dummy.js b/node-tests/fixtures/initializer-test/module-unification/dummy.js
deleted file mode 100644
index 6ef5db4cb45..00000000000
--- a/node-tests/fixtures/initializer-test/module-unification/dummy.js
+++ /dev/null
@@ -1,26 +0,0 @@
-import Application from '@ember/application';
-import { run } from '@ember/runloop';
-
-import { initialize } from 'dummy/init/initializers/foo';
-import { module, test } from 'qunit';
-
-
-module('Unit | Initializer | foo', {
- beforeEach() {
- run(() => {
- this.application = Application.create();
- this.application.deferReadiness();
- });
- },
- afterEach() {
- run(this.application, 'destroy');
- }
-});
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- initialize(this.application);
-
- // you would normally confirm the results of the initializer here
- assert.ok(true);
-});
diff --git a/node-tests/fixtures/initializer-test/module-unification/mocha-rfc232.js b/node-tests/fixtures/initializer-test/module-unification/mocha-rfc232.js
deleted file mode 100644
index 91fbb90f68e..00000000000
--- a/node-tests/fixtures/initializer-test/module-unification/mocha-rfc232.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, beforeEach, afterEach } from 'mocha';
-import Application from '@ember/application';
-import { initialize } from 'my-app/init/initializers/foo';
-import { run } from '@ember/runloop';
-
-describe('Unit | Initializer | foo', function() {
- beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.initializer({
- name: 'initializer under test',
- initialize
- });
-
- this.application = this.TestApplication.create({ autoboot: false });
- });
-
- afterEach(function() {
- run(this.application, 'destroy');
- });
-
- // TODO: Replace this with your real tests.
- it('works', async function() {
- await this.application.boot();
-
- // you would normally confirm the results of the initializer here
- expect(true).to.be.ok;
- });
-});
diff --git a/node-tests/fixtures/initializer-test/module-unification/mocha.js b/node-tests/fixtures/initializer-test/module-unification/mocha.js
deleted file mode 100644
index fddc49536fa..00000000000
--- a/node-tests/fixtures/initializer-test/module-unification/mocha.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, beforeEach, afterEach } from 'mocha';
-import { run } from '@ember/runloop';
-import Application from '@ember/application';
-import { initialize } from 'my-app/init/initializers/foo';
-
-
-describe('Unit | Initializer | foo', function() {
- let application;
-
- beforeEach(function() {
- run(function() {
- application = Application.create();
- application.deferReadiness();
- });
- });
-
- afterEach(function() {
- run(application, 'destroy');
- });
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- initialize(application);
-
- // you would normally confirm the results of the initializer here
- expect(true).to.be.ok;
- });
-});
diff --git a/node-tests/fixtures/initializer-test/module-unification/rfc232.js b/node-tests/fixtures/initializer-test/module-unification/rfc232.js
deleted file mode 100644
index 04a51ea4d36..00000000000
--- a/node-tests/fixtures/initializer-test/module-unification/rfc232.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Application from '@ember/application';
-
-import { initialize } from 'my-app/init/initializers/foo';
-import { module, test } from 'qunit';
-import { run } from '@ember/runloop';
-
-module('Unit | Initializer | foo', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.initializer({
- name: 'initializer under test',
- initialize
- });
-
- this.application = this.TestApplication.create({ autoboot: false });
- });
-
- hooks.afterEach(function() {
- run(this.application, 'destroy');
- });
-
- // TODO: Replace this with your real tests.
- test('it works', async function(assert) {
- await this.application.boot();
-
- assert.ok(true);
- });
-});
diff --git a/node-tests/fixtures/initializer-test/rfc232.js b/node-tests/fixtures/initializer-test/rfc232.js
index 36dcdc6da27..dd5f30c3aed 100644
--- a/node-tests/fixtures/initializer-test/rfc232.js
+++ b/node-tests/fixtures/initializer-test/rfc232.js
@@ -1,26 +1,35 @@
import Application from '@ember/application';
+import config from 'my-app/config/environment';
import { initialize } from 'my-app/initializers/foo';
import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
import { run } from '@ember/runloop';
-module('Unit | Initializer | foo', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
+module('Unit | Initializer | foo', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
this.TestApplication.initializer({
name: 'initializer under test',
- initialize
+ initialize,
});
- this.application = this.TestApplication.create({ autoboot: false });
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
});
- hooks.afterEach(function() {
+ hooks.afterEach(function () {
run(this.application, 'destroy');
});
// TODO: Replace this with your real tests.
- test('it works', async function(assert) {
+ test('it works', async function (assert) {
await this.application.boot();
assert.ok(true);
diff --git a/node-tests/fixtures/initializer/initializer-nested.js b/node-tests/fixtures/initializer/initializer-nested.js
index dfb969b2702..065fae64a51 100644
--- a/node-tests/fixtures/initializer/initializer-nested.js
+++ b/node-tests/fixtures/initializer/initializer-nested.js
@@ -1,7 +1,5 @@
-export function initialize(/* application */) {
- // application.inject('route', 'foo', 'service:foo');
-}
+export function initialize(application) {}
export default {
- initialize
+ initialize,
};
diff --git a/node-tests/fixtures/initializer/initializer.js b/node-tests/fixtures/initializer/initializer.js
index dfb969b2702..065fae64a51 100644
--- a/node-tests/fixtures/initializer/initializer.js
+++ b/node-tests/fixtures/initializer/initializer.js
@@ -1,7 +1,5 @@
-export function initialize(/* application */) {
- // application.inject('route', 'foo', 'service:foo');
-}
+export function initialize(application) {}
export default {
- initialize
+ initialize,
};
diff --git a/node-tests/fixtures/instance-initializer-test/default.js b/node-tests/fixtures/instance-initializer-test/default.js
index 7c4bb90e57a..a9c9927c0f4 100644
--- a/node-tests/fixtures/instance-initializer-test/default.js
+++ b/node-tests/fixtures/instance-initializer-test/default.js
@@ -13,11 +13,11 @@ module('Unit | Instance Initializer | foo', {
afterEach() {
run(this.appInstance, 'destroy');
run(this.application, 'destroy');
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.appInstance);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/instance-initializer-test/dummy.js b/node-tests/fixtures/instance-initializer-test/dummy.js
index 1ab4f1dbff0..55d16cccb36 100644
--- a/node-tests/fixtures/instance-initializer-test/dummy.js
+++ b/node-tests/fixtures/instance-initializer-test/dummy.js
@@ -13,11 +13,11 @@ module('Unit | Instance Initializer | foo', {
afterEach() {
run(this.appInstance, 'destroy');
run(this.application, 'destroy');
- }
+ },
});
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
initialize(this.appInstance);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/instance-initializer-test/mocha-rfc232.js b/node-tests/fixtures/instance-initializer-test/mocha-rfc232.js
index 9c2702d5470..5a7d195336e 100644
--- a/node-tests/fixtures/instance-initializer-test/mocha-rfc232.js
+++ b/node-tests/fixtures/instance-initializer-test/mocha-rfc232.js
@@ -4,23 +4,27 @@ import Application from '@ember/application';
import { initialize } from 'my-app/instance-initializers/foo';
import { run } from '@ember/runloop';
-describe('Unit | Instance Initializer | foo', function() {
- beforeEach(function() {
+describe('Unit | Instance Initializer | foo', function () {
+ beforeEach(function () {
this.TestApplication = Application.extend();
this.TestApplication.instanceInitializer({
name: 'initializer under test',
- initialize
+ initialize,
});
- this.application = this.TestApplication.create({ autoboot: false });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
+ });
+
this.instance = this.application.buildInstance();
});
- afterEach(function() {
+ afterEach(function () {
run(this.instance, 'destroy');
run(this.application, 'destroy');
});
// TODO: Replace this with your real tests.
- it('works', async function() {
+ it('works', async function () {
await this.instance.boot();
expect(true).to.be.ok;
diff --git a/node-tests/fixtures/instance-initializer-test/mocha.js b/node-tests/fixtures/instance-initializer-test/mocha.js
index 50dbe0a1c17..89b409cc033 100644
--- a/node-tests/fixtures/instance-initializer-test/mocha.js
+++ b/node-tests/fixtures/instance-initializer-test/mocha.js
@@ -5,23 +5,23 @@ import { run } from '@ember/runloop';
import { initialize } from 'my-app/instance-initializers/foo';
import destroyApp from '../../helpers/destroy-app';
-describe('Unit | Instance Initializer | foo', function() {
+describe('Unit | Instance Initializer | foo', function () {
let application, appInstance;
- beforeEach(function() {
- run(function() {
+ beforeEach(function () {
+ run(function () {
application = Application.create();
appInstance = application.buildInstance();
});
});
- afterEach(function() {
+ afterEach(function () {
run(appInstance, 'destroy');
destroyApp(application);
});
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
initialize(appInstance);
// you would normally confirm the results of the initializer here
diff --git a/node-tests/fixtures/instance-initializer-test/module-unification/default.js b/node-tests/fixtures/instance-initializer-test/module-unification/default.js
deleted file mode 100644
index 3fb5614db4e..00000000000
--- a/node-tests/fixtures/instance-initializer-test/module-unification/default.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import Application from '@ember/application';
-import { run } from '@ember/runloop';
-import { initialize } from 'my-app/init/instance-initializers/foo';
-import { module, test } from 'qunit';
-
-module('Unit | Instance Initializer | foo', {
- beforeEach() {
- run(() => {
- this.application = Application.create();
- this.appInstance = this.application.buildInstance();
- });
- },
- afterEach() {
- run(this.appInstance, 'destroy');
- run(this.application, 'destroy');
- }
-});
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- initialize(this.appInstance);
-
- // you would normally confirm the results of the initializer here
- assert.ok(true);
-});
diff --git a/node-tests/fixtures/instance-initializer-test/module-unification/dummy.js b/node-tests/fixtures/instance-initializer-test/module-unification/dummy.js
deleted file mode 100644
index c8fe5b8ad4c..00000000000
--- a/node-tests/fixtures/instance-initializer-test/module-unification/dummy.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import Application from '@ember/application';
-import { run } from '@ember/runloop';
-import { initialize } from 'dummy/init/instance-initializers/foo';
-import { module, test } from 'qunit';
-
-module('Unit | Instance Initializer | foo', {
- beforeEach() {
- run(() => {
- this.application = Application.create();
- this.appInstance = this.application.buildInstance();
- });
- },
- afterEach() {
- run(this.appInstance, 'destroy');
- run(this.application, 'destroy');
- }
-});
-
-// TODO: Replace this with your real tests.
-test('it works', function(assert) {
- initialize(this.appInstance);
-
- // you would normally confirm the results of the initializer here
- assert.ok(true);
-});
diff --git a/node-tests/fixtures/instance-initializer-test/module-unification/mocha-rfc232.js b/node-tests/fixtures/instance-initializer-test/module-unification/mocha-rfc232.js
deleted file mode 100644
index 052dd2806c7..00000000000
--- a/node-tests/fixtures/instance-initializer-test/module-unification/mocha-rfc232.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, beforeEach, afterEach } from 'mocha';
-import Application from '@ember/application';
-import { initialize } from 'my-app/init/instance-initializers/foo';
-import { run } from '@ember/runloop';
-
-describe('Unit | Instance Initializer | foo', function() {
- beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.instanceInitializer({
- name: 'initializer under test',
- initialize
- });
- this.application = this.TestApplication.create({ autoboot: false });
- this.instance = this.application.buildInstance();
- });
- afterEach(function() {
- run(this.instance, 'destroy');
- run(this.application, 'destroy');
- });
-
- // TODO: Replace this with your real tests.
- it('works', async function() {
- await this.instance.boot();
-
- expect(true).to.be.ok;
- });
-});
diff --git a/node-tests/fixtures/instance-initializer-test/module-unification/mocha.js b/node-tests/fixtures/instance-initializer-test/module-unification/mocha.js
deleted file mode 100644
index a37bc43820c..00000000000
--- a/node-tests/fixtures/instance-initializer-test/module-unification/mocha.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import { expect } from 'chai';
-import { describe, it, afterEach, beforeEach } from 'mocha';
-import Application from '@ember/application';
-import { run } from '@ember/runloop';
-import { initialize } from 'my-app/init/instance-initializers/foo';
-import destroyApp from '../../helpers/destroy-app';
-
-describe('Unit | Instance Initializer | foo', function() {
- let application, appInstance;
-
- beforeEach(function() {
- run(function() {
- application = Application.create();
- appInstance = application.buildInstance();
- });
- });
-
- afterEach(function() {
- run(appInstance, 'destroy');
- destroyApp(application);
- });
-
- // TODO: Replace this with your real tests.
- it('works', function() {
- initialize(appInstance);
-
- // you would normally confirm the results of the initializer here
- expect(true).to.be.ok;
- });
-});
diff --git a/node-tests/fixtures/instance-initializer-test/module-unification/rfc232.js b/node-tests/fixtures/instance-initializer-test/module-unification/rfc232.js
deleted file mode 100644
index 4c97d5f64bf..00000000000
--- a/node-tests/fixtures/instance-initializer-test/module-unification/rfc232.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Application from '@ember/application';
-
-import { initialize } from 'my-app/init/instance-initializers/foo';
-import { module, test } from 'qunit';
-import { run } from '@ember/runloop';
-
-module('Unit | Instance Initializer | foo', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
- this.TestApplication.instanceInitializer({
- name: 'initializer under test',
- initialize
- });
- this.application = this.TestApplication.create({ autoboot: false });
- this.instance = this.application.buildInstance();
- });
- hooks.afterEach(function() {
- run(this.instance, 'destroy');
- run(this.application, 'destroy');
- });
-
- // TODO: Replace this with your real tests.
- test('it works', async function(assert) {
- await this.instance.boot();
-
- assert.ok(true);
- });
-});
diff --git a/node-tests/fixtures/instance-initializer-test/rfc232.js b/node-tests/fixtures/instance-initializer-test/rfc232.js
index c6f693da2ce..1547b9c874e 100644
--- a/node-tests/fixtures/instance-initializer-test/rfc232.js
+++ b/node-tests/fixtures/instance-initializer-test/rfc232.js
@@ -1,26 +1,37 @@
import Application from '@ember/application';
+import config from 'my-app/config/environment';
import { initialize } from 'my-app/instance-initializers/foo';
import { module, test } from 'qunit';
+import Resolver from 'ember-resolver';
import { run } from '@ember/runloop';
-module('Unit | Instance Initializer | foo', function(hooks) {
- hooks.beforeEach(function() {
- this.TestApplication = Application.extend();
+module('Unit | Instance Initializer | foo', function (hooks) {
+ hooks.beforeEach(function () {
+ this.TestApplication = class TestApplication extends Application {
+ modulePrefix = config.modulePrefix;
+ podModulePrefix = config.podModulePrefix;
+ Resolver = Resolver;
+ };
+
this.TestApplication.instanceInitializer({
name: 'initializer under test',
- initialize
+ initialize,
+ });
+
+ this.application = this.TestApplication.create({
+ autoboot: false,
});
- this.application = this.TestApplication.create({ autoboot: false });
+
this.instance = this.application.buildInstance();
});
- hooks.afterEach(function() {
+ hooks.afterEach(function () {
run(this.instance, 'destroy');
run(this.application, 'destroy');
});
// TODO: Replace this with your real tests.
- test('it works', async function(assert) {
+ test('it works', async function (assert) {
await this.instance.boot();
assert.ok(true);
diff --git a/node-tests/fixtures/instance-initializer/instance-initializer-nested.js b/node-tests/fixtures/instance-initializer/instance-initializer-nested.js
index 2f84dce8d92..e0281ca4e7e 100644
--- a/node-tests/fixtures/instance-initializer/instance-initializer-nested.js
+++ b/node-tests/fixtures/instance-initializer/instance-initializer-nested.js
@@ -1,7 +1,5 @@
-export function initialize(/* appInstance */) {
- // appInstance.inject('route', 'foo', 'service:foo');
-}
+export function initialize(owner) {}
export default {
- initialize
+ initialize,
};
diff --git a/node-tests/fixtures/instance-initializer/instance-initializer.js b/node-tests/fixtures/instance-initializer/instance-initializer.js
index 2f84dce8d92..e0281ca4e7e 100644
--- a/node-tests/fixtures/instance-initializer/instance-initializer.js
+++ b/node-tests/fixtures/instance-initializer/instance-initializer.js
@@ -1,7 +1,5 @@
-export function initialize(/* appInstance */) {
- // appInstance.inject('route', 'foo', 'service:foo');
-}
+export function initialize(owner) {}
export default {
- initialize
+ initialize,
};
diff --git a/node-tests/fixtures/mixin-test/addon.js b/node-tests/fixtures/mixin-test/addon.js
index da7da2da1fc..73ed2ccabe6 100644
--- a/node-tests/fixtures/mixin-test/addon.js
+++ b/node-tests/fixtures/mixin-test/addon.js
@@ -5,7 +5,7 @@ import { module, test } from 'qunit';
module('Unit | Mixin | foo');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
assert.ok(subject);
diff --git a/node-tests/fixtures/mixin-test/default.js b/node-tests/fixtures/mixin-test/default.js
index 1880e85c7b4..070c444471d 100644
--- a/node-tests/fixtures/mixin-test/default.js
+++ b/node-tests/fixtures/mixin-test/default.js
@@ -5,7 +5,7 @@ import { module, test } from 'qunit';
module('Unit | Mixin | foo');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
assert.ok(subject);
diff --git a/node-tests/fixtures/mixin-test/mocha-rfc232.js b/node-tests/fixtures/mixin-test/mocha-rfc232.js
index 449cd5d41b6..4c261059db6 100644
--- a/node-tests/fixtures/mixin-test/mocha-rfc232.js
+++ b/node-tests/fixtures/mixin-test/mocha-rfc232.js
@@ -3,9 +3,9 @@ import { describe, it } from 'mocha';
import EmberObject from '@ember/object';
import FooMixin from 'my-app/mixins/foo';
-describe('Unit | Mixin | foo', function() {
+describe('Unit | Mixin | foo', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
expect(subject).to.be.ok;
diff --git a/node-tests/fixtures/mixin-test/mocha.js b/node-tests/fixtures/mixin-test/mocha.js
index 449cd5d41b6..4c261059db6 100644
--- a/node-tests/fixtures/mixin-test/mocha.js
+++ b/node-tests/fixtures/mixin-test/mocha.js
@@ -3,9 +3,9 @@ import { describe, it } from 'mocha';
import EmberObject from '@ember/object';
import FooMixin from 'my-app/mixins/foo';
-describe('Unit | Mixin | foo', function() {
+describe('Unit | Mixin | foo', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let FooObject = EmberObject.extend(FooMixin);
let subject = FooObject.create();
expect(subject).to.be.ok;
diff --git a/node-tests/fixtures/mixin-test/rfc232.js b/node-tests/fixtures/mixin-test/rfc232.js
index 2b76ff468a4..78c90f206b5 100644
--- a/node-tests/fixtures/mixin-test/rfc232.js
+++ b/node-tests/fixtures/mixin-test/rfc232.js
@@ -2,7 +2,7 @@ import EmberObject from '@ember/object';
import FooMixin from 'my-app/mixins/foo';
import { module, test } from 'qunit';
-module('Unit | Mixin | foo', function() {
+module('Unit | Mixin | foo', function () {
// TODO: Replace this with your real tests.
test('it works', function (assert) {
let FooObject = EmberObject.extend(FooMixin);
diff --git a/node-tests/fixtures/route-test/default-child.js b/node-tests/fixtures/route-test/default-child.js
index 6ab71d91996..6e0f2ea37a3 100644
--- a/node-tests/fixtures/route-test/default-child.js
+++ b/node-tests/fixtures/route-test/default-child.js
@@ -5,7 +5,7 @@ moduleFor('route:child', 'Unit | Route | parent/child', {
// needs: ['controller:foo']
});
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let route = this.subject();
assert.ok(route);
});
diff --git a/node-tests/fixtures/route-test/default-nested.js b/node-tests/fixtures/route-test/default-nested.js
index 2484d6bd626..8bea0da02a6 100644
--- a/node-tests/fixtures/route-test/default-nested.js
+++ b/node-tests/fixtures/route-test/default-nested.js
@@ -5,7 +5,7 @@ moduleFor('route:foo/bar', 'Unit | Route | foo/bar', {
// needs: ['controller:foo']
});
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let route = this.subject();
assert.ok(route);
});
diff --git a/node-tests/fixtures/route-test/default.js b/node-tests/fixtures/route-test/default.js
index 52c198bce1f..d8b44fbee47 100644
--- a/node-tests/fixtures/route-test/default.js
+++ b/node-tests/fixtures/route-test/default.js
@@ -5,7 +5,7 @@ moduleFor('route:foo', 'Unit | Route | foo', {
// needs: ['controller:foo']
});
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let route = this.subject();
assert.ok(route);
});
diff --git a/node-tests/fixtures/route-test/mocha-0.12.js b/node-tests/fixtures/route-test/mocha-0.12.js
index dbcda035e7e..8ac8c375168 100644
--- a/node-tests/fixtures/route-test/mocha-0.12.js
+++ b/node-tests/fixtures/route-test/mocha-0.12.js
@@ -2,13 +2,13 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('Unit | Route | foo', function() {
+describe('Unit | Route | foo', function () {
setupTest('route:foo', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
- it('exists', function() {
+ it('exists', function () {
let route = this.subject();
expect(route).to.be.ok;
});
diff --git a/node-tests/fixtures/route-test/mocha-rfc232-addon.js b/node-tests/fixtures/route-test/mocha-rfc232-addon.js
new file mode 100644
index 00000000000..6234ea8e294
--- /dev/null
+++ b/node-tests/fixtures/route-test/mocha-rfc232-addon.js
@@ -0,0 +1,12 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'dummy/tests/helpers';
+
+describe('Unit | Route | foo', function () {
+ setupTest();
+
+ it('exists', function () {
+ let route = this.owner.lookup('route:foo');
+ expect(route).to.be.ok;
+ });
+});
diff --git a/node-tests/fixtures/route-test/mocha-rfc232.js b/node-tests/fixtures/route-test/mocha-rfc232.js
index b368708f37e..b6435e1b089 100644
--- a/node-tests/fixtures/route-test/mocha-rfc232.js
+++ b/node-tests/fixtures/route-test/mocha-rfc232.js
@@ -1,11 +1,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
+import { setupTest } from 'my-app/tests/helpers';
-describe('Unit | Route | foo', function() {
+describe('Unit | Route | foo', function () {
setupTest();
- it('exists', function() {
+ it('exists', function () {
let route = this.owner.lookup('route:foo');
expect(route).to.be.ok;
});
diff --git a/node-tests/fixtures/route-test/mocha.js b/node-tests/fixtures/route-test/mocha.js
index 59064a5f868..11328c6913c 100644
--- a/node-tests/fixtures/route-test/mocha.js
+++ b/node-tests/fixtures/route-test/mocha.js
@@ -1,13 +1,15 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('route:foo', 'Unit | Route | foo',
+describeModule(
+ 'route:foo',
+ 'Unit | Route | foo',
{
// Specify the other units that are required for this test.
// needs: ['controller:foo']
},
- function() {
- it('exists', function() {
+ function () {
+ it('exists', function () {
let route = this.subject();
expect(route).to.be.ok;
});
diff --git a/node-tests/fixtures/route-test/rfc232-addon.js b/node-tests/fixtures/route-test/rfc232-addon.js
new file mode 100644
index 00000000000..3c342db100a
--- /dev/null
+++ b/node-tests/fixtures/route-test/rfc232-addon.js
@@ -0,0 +1,11 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'dummy/tests/helpers';
+
+module('Unit | Route | foo', function (hooks) {
+ setupTest(hooks);
+
+ test('it exists', function (assert) {
+ let route = this.owner.lookup('route:foo');
+ assert.ok(route);
+ });
+});
diff --git a/node-tests/fixtures/route-test/rfc232.js b/node-tests/fixtures/route-test/rfc232.js
index eec4697f0a0..25c080eed61 100644
--- a/node-tests/fixtures/route-test/rfc232.js
+++ b/node-tests/fixtures/route-test/rfc232.js
@@ -1,10 +1,10 @@
import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
+import { setupTest } from 'my-app/tests/helpers';
-module('Unit | Route | foo', function(hooks) {
+module('Unit | Route | foo', function (hooks) {
setupTest(hooks);
- test('it exists', function(assert) {
+ test('it exists', function (assert) {
let route = this.owner.lookup('route:foo');
assert.ok(route);
});
diff --git a/node-tests/fixtures/route/native-route-child.js b/node-tests/fixtures/route/native-route-child.js
deleted file mode 100644
index 8481ba97ba5..00000000000
--- a/node-tests/fixtures/route/native-route-child.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Route from '@ember/routing/route';
-
-export default class ParentChildRoute extends Route {
-}
diff --git a/node-tests/fixtures/route/native-route-nested.js b/node-tests/fixtures/route/native-route-nested.js
deleted file mode 100644
index 5a0c1661f75..00000000000
--- a/node-tests/fixtures/route/native-route-nested.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Route from '@ember/routing/route';
-
-export default class FooBarRoute extends Route {
-}
diff --git a/node-tests/fixtures/route/native-route.js b/node-tests/fixtures/route/native-route.js
deleted file mode 100644
index fa31033660d..00000000000
--- a/node-tests/fixtures/route/native-route.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Route from '@ember/routing/route';
-
-export default class FooRoute extends Route {
-}
diff --git a/node-tests/fixtures/route/route-child.js b/node-tests/fixtures/route/route-child.js
index 6c74252aa1b..1c7ff09d7f3 100644
--- a/node-tests/fixtures/route/route-child.js
+++ b/node-tests/fixtures/route/route-child.js
@@ -1,4 +1,3 @@
import Route from '@ember/routing/route';
-export default Route.extend({
-});
+export default class ParentChildRoute extends Route {}
diff --git a/node-tests/fixtures/route/route-nested.js b/node-tests/fixtures/route/route-nested.js
index 6c74252aa1b..ef44fb6e59f 100644
--- a/node-tests/fixtures/route/route-nested.js
+++ b/node-tests/fixtures/route/route-nested.js
@@ -1,4 +1,3 @@
import Route from '@ember/routing/route';
-export default Route.extend({
-});
+export default class FooBarRoute extends Route {}
diff --git a/node-tests/fixtures/route/route-with-dynamic-segment.js b/node-tests/fixtures/route/route-with-dynamic-segment.js
new file mode 100644
index 00000000000..c31543f32ad
--- /dev/null
+++ b/node-tests/fixtures/route/route-with-dynamic-segment.js
@@ -0,0 +1,9 @@
+import Route from '@ember/routing/route';
+
+export default class FooRoute extends Route {
+ model(params) {
+ // This route was generated with a dynamic segment. Implement data loading
+ // based on that dynamic segment here in the model hook.
+ return params;
+ }
+}
diff --git a/node-tests/fixtures/route/route.js b/node-tests/fixtures/route/route.js
index 6c74252aa1b..311d0a00f1c 100644
--- a/node-tests/fixtures/route/route.js
+++ b/node-tests/fixtures/route/route.js
@@ -1,4 +1,3 @@
import Route from '@ember/routing/route';
-export default Route.extend({
-});
+export default class FooRoute extends Route {}
diff --git a/node-tests/fixtures/service-test/default-nested.js b/node-tests/fixtures/service-test/default-nested.js
index a2acf7ea09d..e0200f9c32b 100644
--- a/node-tests/fixtures/service-test/default-nested.js
+++ b/node-tests/fixtures/service-test/default-nested.js
@@ -6,7 +6,7 @@ moduleFor('service:foo/bar', 'Unit | Service | foo/bar', {
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let service = this.subject();
assert.ok(service);
});
diff --git a/node-tests/fixtures/service-test/default.js b/node-tests/fixtures/service-test/default.js
index 2e5321ecd48..e3edff4a145 100644
--- a/node-tests/fixtures/service-test/default.js
+++ b/node-tests/fixtures/service-test/default.js
@@ -6,7 +6,7 @@ moduleFor('service:foo', 'Unit | Service | foo', {
});
// TODO: Replace this with your real tests.
-test('it exists', function(assert) {
+test('it exists', function (assert) {
let service = this.subject();
assert.ok(service);
});
diff --git a/node-tests/fixtures/service-test/mocha-0.12.js b/node-tests/fixtures/service-test/mocha-0.12.js
index bf2023f1f49..694b3603d55 100644
--- a/node-tests/fixtures/service-test/mocha-0.12.js
+++ b/node-tests/fixtures/service-test/mocha-0.12.js
@@ -2,14 +2,14 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';
-describe('Unit | Service | foo', function() {
+describe('Unit | Service | foo', function () {
setupTest('service:foo', {
// Specify the other units that are required for this test.
// needs: ['service:foo']
});
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let service = this.subject();
expect(service).to.be.ok;
});
diff --git a/node-tests/fixtures/service-test/mocha-rfc232-addon.js b/node-tests/fixtures/service-test/mocha-rfc232-addon.js
new file mode 100644
index 00000000000..e3e672f970c
--- /dev/null
+++ b/node-tests/fixtures/service-test/mocha-rfc232-addon.js
@@ -0,0 +1,13 @@
+import { expect } from 'chai';
+import { describe, it } from 'mocha';
+import { setupTest } from 'dummy/tests/helpers';
+
+describe('Unit | Service | foo', function () {
+ setupTest();
+
+ // TODO: Replace this with your real tests.
+ it('exists', function () {
+ let service = this.owner.lookup('service:foo');
+ expect(service).to.be.ok;
+ });
+});
diff --git a/node-tests/fixtures/service-test/mocha-rfc232.js b/node-tests/fixtures/service-test/mocha-rfc232.js
index 65905b9e1ec..ceae7203f34 100644
--- a/node-tests/fixtures/service-test/mocha-rfc232.js
+++ b/node-tests/fixtures/service-test/mocha-rfc232.js
@@ -1,12 +1,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
-import { setupTest } from 'ember-mocha';
+import { setupTest } from 'my-app/tests/helpers';
-describe('Unit | Service | foo', function() {
+describe('Unit | Service | foo', function () {
setupTest();
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let service = this.owner.lookup('service:foo');
expect(service).to.be.ok;
});
diff --git a/node-tests/fixtures/service-test/mocha.js b/node-tests/fixtures/service-test/mocha.js
index f8909b0a8c2..b03dd281787 100644
--- a/node-tests/fixtures/service-test/mocha.js
+++ b/node-tests/fixtures/service-test/mocha.js
@@ -1,14 +1,16 @@
import { expect } from 'chai';
import { describeModule, it } from 'ember-mocha';
-describeModule('service:foo', 'Unit | Service | foo',
+describeModule(
+ 'service:foo',
+ 'Unit | Service | foo',
{
// Specify the other units that are required for this test.
// needs: ['service:foo']
},
- function() {
+ function () {
// TODO: Replace this with your real tests.
- it('exists', function() {
+ it('exists', function () {
let service = this.subject();
expect(service).to.be.ok;
});
diff --git a/node-tests/fixtures/service-test/rfc232-addon.js b/node-tests/fixtures/service-test/rfc232-addon.js
new file mode 100644
index 00000000000..9268712dd82
--- /dev/null
+++ b/node-tests/fixtures/service-test/rfc232-addon.js
@@ -0,0 +1,12 @@
+import { module, test } from 'qunit';
+import { setupTest } from 'dummy/tests/helpers';
+
+module('Unit | Service | foo', function (hooks) {
+ setupTest(hooks);
+
+ // TODO: Replace this with your real tests.
+ test('it exists', function (assert) {
+ let service = this.owner.lookup('service:foo');
+ assert.ok(service);
+ });
+});
diff --git a/node-tests/fixtures/service-test/rfc232.js b/node-tests/fixtures/service-test/rfc232.js
index 9d6efae3174..1ae3f96b1eb 100644
--- a/node-tests/fixtures/service-test/rfc232.js
+++ b/node-tests/fixtures/service-test/rfc232.js
@@ -1,11 +1,11 @@
import { module, test } from 'qunit';
-import { setupTest } from 'ember-qunit';
+import { setupTest } from 'my-app/tests/helpers';
-module('Unit | Service | foo', function(hooks) {
+module('Unit | Service | foo', function (hooks) {
setupTest(hooks);
// TODO: Replace this with your real tests.
- test('it exists', function(assert) {
+ test('it exists', function (assert) {
let service = this.owner.lookup('service:foo');
assert.ok(service);
});
diff --git a/node-tests/fixtures/service/native-service-nested.js b/node-tests/fixtures/service/native-service-nested.js
deleted file mode 100644
index b6205148786..00000000000
--- a/node-tests/fixtures/service/native-service-nested.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Service from '@ember/service';
-
-export default class FooBarService extends Service {
-}
diff --git a/node-tests/fixtures/service/native-service.js b/node-tests/fixtures/service/native-service.js
deleted file mode 100644
index 8447de6df53..00000000000
--- a/node-tests/fixtures/service/native-service.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import Service from '@ember/service';
-
-export default class FooService extends Service {
-}
diff --git a/node-tests/fixtures/service/service-nested.js b/node-tests/fixtures/service/service-nested.js
index 2c0547143aa..25979e899ca 100644
--- a/node-tests/fixtures/service/service-nested.js
+++ b/node-tests/fixtures/service/service-nested.js
@@ -1,4 +1,3 @@
import Service from '@ember/service';
-export default Service.extend({
-});
+export default class FooBarService extends Service {}
diff --git a/node-tests/fixtures/service/service.js b/node-tests/fixtures/service/service.js
index 2c0547143aa..f26f8b62490 100644
--- a/node-tests/fixtures/service/service.js
+++ b/node-tests/fixtures/service/service.js
@@ -1,4 +1,3 @@
import Service from '@ember/service';
-export default Service.extend({
-});
+export default class FooService extends Service {}
diff --git a/node-tests/fixtures/util-test/addon-default-nested.js b/node-tests/fixtures/util-test/addon-default-nested.js
index e1ffab78d16..6d88f77241d 100644
--- a/node-tests/fixtures/util-test/addon-default-nested.js
+++ b/node-tests/fixtures/util-test/addon-default-nested.js
@@ -4,7 +4,7 @@ import { module, test } from 'qunit';
module('Unit | Utility | foo/bar-baz');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = fooBarBaz();
assert.ok(result);
});
diff --git a/node-tests/fixtures/util-test/addon-default.js b/node-tests/fixtures/util-test/addon-default.js
index 164b20ab8ff..ce2487e6193 100644
--- a/node-tests/fixtures/util-test/addon-default.js
+++ b/node-tests/fixtures/util-test/addon-default.js
@@ -4,7 +4,7 @@ import { module, test } from 'qunit';
module('Unit | Utility | foo-bar');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = fooBar();
assert.ok(result);
});
diff --git a/node-tests/fixtures/util-test/default-nested.js b/node-tests/fixtures/util-test/default-nested.js
index 9688d485e6e..26f82416b54 100644
--- a/node-tests/fixtures/util-test/default-nested.js
+++ b/node-tests/fixtures/util-test/default-nested.js
@@ -4,7 +4,7 @@ import { module, test } from 'qunit';
module('Unit | Utility | foo/bar-baz');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = fooBarBaz();
assert.ok(result);
});
diff --git a/node-tests/fixtures/util-test/default.js b/node-tests/fixtures/util-test/default.js
index 44ccfaa7f2d..dc3851312bb 100644
--- a/node-tests/fixtures/util-test/default.js
+++ b/node-tests/fixtures/util-test/default.js
@@ -4,7 +4,7 @@ import { module, test } from 'qunit';
module('Unit | Utility | foo-bar');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = fooBar();
assert.ok(result);
});
diff --git a/node-tests/fixtures/util-test/dummy.js b/node-tests/fixtures/util-test/dummy.js
index 164b20ab8ff..ce2487e6193 100644
--- a/node-tests/fixtures/util-test/dummy.js
+++ b/node-tests/fixtures/util-test/dummy.js
@@ -4,7 +4,7 @@ import { module, test } from 'qunit';
module('Unit | Utility | foo-bar');
// TODO: Replace this with your real tests.
-test('it works', function(assert) {
+test('it works', function (assert) {
let result = fooBar();
assert.ok(result);
});
diff --git a/node-tests/fixtures/util-test/mocha-rfc232.js b/node-tests/fixtures/util-test/mocha-rfc232.js
index d99ec534e41..2e76e59d5e5 100644
--- a/node-tests/fixtures/util-test/mocha-rfc232.js
+++ b/node-tests/fixtures/util-test/mocha-rfc232.js
@@ -2,9 +2,9 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import fooBar from 'my-app/utils/foo-bar';
-describe('Unit | Utility | foo-bar', function() {
+describe('Unit | Utility | foo-bar', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let result = fooBar();
expect(result).to.be.ok;
});
diff --git a/node-tests/fixtures/util-test/mocha.js b/node-tests/fixtures/util-test/mocha.js
index d99ec534e41..2e76e59d5e5 100644
--- a/node-tests/fixtures/util-test/mocha.js
+++ b/node-tests/fixtures/util-test/mocha.js
@@ -2,9 +2,9 @@ import { expect } from 'chai';
import { describe, it } from 'mocha';
import fooBar from 'my-app/utils/foo-bar';
-describe('Unit | Utility | foo-bar', function() {
+describe('Unit | Utility | foo-bar', function () {
// TODO: Replace this with your real tests.
- it('works', function() {
+ it('works', function () {
let result = fooBar();
expect(result).to.be.ok;
});
diff --git a/node-tests/fixtures/util-test/rfc232.js b/node-tests/fixtures/util-test/rfc232.js
index 45a0a808ffc..d7c5def38ea 100644
--- a/node-tests/fixtures/util-test/rfc232.js
+++ b/node-tests/fixtures/util-test/rfc232.js
@@ -1,10 +1,9 @@
import fooBar from 'my-app/utils/foo-bar';
import { module, test } from 'qunit';
-module('Unit | Utility | foo-bar', function() {
-
+module('Unit | Utility | foo-bar', function () {
// TODO: Replace this with your real tests.
- test('it works', function(assert) {
+ test('it works', function (assert) {
let result = fooBar();
assert.ok(result);
});
diff --git a/node-tests/helpers/expect-error.js b/node-tests/helpers/expect-error.js
index e8265a0a3d5..e9eda641846 100644
--- a/node-tests/helpers/expect-error.js
+++ b/node-tests/helpers/expect-error.js
@@ -8,7 +8,7 @@ module.exports = function expectError(promise, expectedErrorText) {
.then(() => {
throw new Error('the command should raise an exception');
})
- .catch(error => {
+ .catch((error) => {
expect(error.message).to.equal(expectedErrorText);
});
};
diff --git a/node-tests/helpers/fixture.js b/node-tests/helpers/fixture.js
index e2ab920abb0..b55cde25f1c 100644
--- a/node-tests/helpers/fixture.js
+++ b/node-tests/helpers/fixture.js
@@ -4,7 +4,7 @@ const path = require('path');
const file = require('ember-cli-blueprint-test-helpers/chai').file;
const fs = require('fs');
-module.exports = function(filePath, options) {
+module.exports = function (filePath, options) {
if (!options) {
return file(path.join(__dirname, '../fixtures', filePath));
}
diff --git a/node-tests/helpers/setup-test-environment.js b/node-tests/helpers/setup-test-environment.js
index cf1af8322e0..25d9a60deb4 100644
--- a/node-tests/helpers/setup-test-environment.js
+++ b/node-tests/helpers/setup-test-environment.js
@@ -1,26 +1,15 @@
const { setEdition, clearEdition } = require('@ember/edition-utils');
function enableOctane() {
- beforeEach(function() {
+ beforeEach(function () {
setEdition('octane');
});
- afterEach(function() {
+ afterEach(function () {
clearEdition();
});
}
-function enableModuleUnification() {
- beforeEach(function() {
- process.env.EMBER_CLI_MODULE_UNIFICATION = 'true';
- });
-
- afterEach(function() {
- delete process.env.EMBER_CLI_MODULE_UNIFICATION;
- });
-}
-
module.exports = {
- enableModuleUnification,
enableOctane,
};
diff --git a/package.json b/package.json
index fb2bf5c70f5..894f1bc5241 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ember-source",
- "version": "3.20.0",
+ "version": "4.12.3",
"description": "A JavaScript framework for creating ambitious web applications",
"keywords": [
"ember-addon"
@@ -14,6 +14,7 @@
"files": [
"build-metadata.json",
"blueprints",
+ "blueprints-js",
"dist/packages",
"dist/dependencies",
"dist/header",
@@ -24,131 +25,162 @@
"dist/ember-testing.js",
"dist/ember-testing.map",
"docs/data.json",
- "lib"
+ "lib",
+ "types"
],
"repository": {
"type": "git",
"url": "git+https://github.com/emberjs/ember.js.git"
},
"scripts": {
- "build": "ember build --environment production",
+ "build:js": "ember build --environment production",
+ "build:types": "node types/publish.mjs",
+ "build": "npm-run-all build:*",
"docs": "ember ember-cli-yuidoc",
"link:glimmer": "node bin/yarn-link-glimmer.js",
"start": "ember serve",
- "lint": "yarn lint:tsc && yarn lint:tslint && yarn lint:eslint && yarn lint:docs",
+ "lint": "npm-run-all --continue-on-error --aggregate-output --parallel \"lint:!(fix)\"",
"lint:docs": "qunit tests/docs/coverage-test.js",
- "lint:eslint": "eslint . --cache --ext=js,ts",
- "lint:tsc": "tsc --noEmit",
- "lint:tslint": "tslint -p tsconfig.json",
- "lint:fix": "yarn lint:eslint --fix && yarn lint:tslint --fix",
+ "lint:eslint": "eslint --report-unused-disable-directives --cache .",
+ "lint:eslint:fix": "npm-run-all \"lint:eslint --fix\"",
+ "lint:fix": "npm-run-all lint:*:fix",
"test": "node bin/run-tests.js",
- "test:blueprints": "mocha node-tests/blueprints/**/*-test.js",
+ "test:blueprints:js": "EMBER_TYPESCRIPT_BLUEPRINTS=false yarn test:blueprints:ts",
+ "test:blueprints:ts": "mocha node-tests/blueprints/**/*-test.js",
+ "test:blueprints": "yarn test:blueprints:js && yarn test:blueprints:ts",
"test:node": "qunit tests/node/**/*-test.js",
- "test:browserstack": "node bin/run-browserstack-tests.js"
+ "test:browserstack": "node bin/run-browserstack-tests.js",
+ "type-check:internals": "tsc --noEmit",
+ "type-check:types": "yarn build:types && tsc --noEmit --project type-tests",
+ "type-check": "npm-run-all type-check:*"
},
"dependencies": {
- "@babel/helper-module-imports": "^7.8.3",
- "@babel/plugin-transform-block-scoping": "^7.8.3",
- "@babel/plugin-transform-object-assign": "^7.8.3",
+ "@babel/helper-module-imports": "^7.16.7",
+ "@babel/plugin-transform-block-scoping": "^7.20.5",
"@ember/edition-utils": "^1.2.0",
- "babel-plugin-debug-macros": "^0.3.3",
+ "@simple-dom/interface": "^1.4.0",
+ "@glimmer/vm-babel-plugins": "0.84.2",
+ "babel-plugin-debug-macros": "^0.3.4",
"babel-plugin-filter-imports": "^4.0.0",
- "broccoli-concat": "^4.2.4",
+ "broccoli-concat": "^4.2.5",
"broccoli-debug": "^0.6.4",
- "broccoli-funnel": "^2.0.2",
+ "broccoli-file-creator": "^2.1.1",
+ "broccoli-funnel": "^3.0.8",
"broccoli-merge-trees": "^4.2.0",
"chalk": "^4.0.0",
- "ember-cli-babel": "^7.19.0",
+ "ember-auto-import": "^2.5.0",
+ "ember-cli-babel": "^7.26.11",
"ember-cli-get-component-path-option": "^1.0.0",
"ember-cli-is-package-missing": "^1.0.0",
"ember-cli-normalize-entity-name": "^1.0.0",
"ember-cli-path-utils": "^1.0.0",
"ember-cli-string-utils": "^1.1.0",
- "ember-cli-version-checker": "^5.1.1",
+ "ember-cli-typescript-blueprint-polyfill": "^0.1.0",
+ "ember-cli-version-checker": "^5.1.2",
"ember-router-generator": "^2.0.0",
- "inflection": "^1.12.0",
- "jquery": "^3.5.0",
- "resolve": "^1.17.0",
- "semver": "^6.1.1",
+ "inflection": "^1.13.2",
+ "resolve": "^1.22.0",
+ "semver": "^7.3.8",
"silent-error": "^1.1.1"
},
"devDependencies": {
- "@babel/preset-env": "^7.9.5",
- "@glimmer/compiler": "^0.53.0",
+ "@babel/preset-env": "^7.16.11",
+ "@glimmer/compiler": "0.84.2",
+ "@glimmer/component": "^1.1.2",
+ "@glimmer/destroyable": "0.84.2",
"@glimmer/env": "^0.1.7",
- "@glimmer/interfaces": "^0.53.0",
- "@glimmer/node": "^0.53.0",
- "@glimmer/opcode-compiler": "^0.53.0",
- "@glimmer/program": "^0.53.0",
- "@glimmer/reference": "^0.53.0",
- "@glimmer/runtime": "^0.53.0",
- "@glimmer/validator": "^0.53.0",
+ "@glimmer/global-context": "0.84.2",
+ "@glimmer/interfaces": "0.84.2",
+ "@glimmer/manager": "0.84.2",
+ "@glimmer/node": "0.84.2",
+ "@glimmer/opcode-compiler": "0.84.2",
+ "@glimmer/owner": "0.84.2",
+ "@glimmer/program": "0.84.2",
+ "@glimmer/reference": "0.84.2",
+ "@glimmer/runtime": "0.84.2",
+ "@glimmer/validator": "0.84.2",
"@simple-dom/document": "^1.4.0",
- "@types/qunit": "^2.9.1",
- "@types/rsvp": "^4.0.3",
- "@typescript-eslint/parser": "^2.33.0",
- "auto-dist-tag": "^1.0.0",
- "aws-sdk": "^2.674.0",
- "babel-eslint": "^10.1.0",
- "babel-plugin-module-resolver": "^4.0.0",
+ "@tsconfig/ember": "^1.0.1",
+ "@types/node": "^18.11.11",
+ "@types/qunit": "^2.19.2",
+ "@types/rsvp": "^4.0.4",
+ "@typescript-eslint/eslint-plugin": "^5.50.0",
+ "@typescript-eslint/parser": "^5.51.0",
+ "ast-types": "^0.14.2",
+ "auto-dist-tag": "^2.1.1",
+ "aws-sdk": "^2.1286.0",
"babel-template": "^6.26.0",
- "backburner.js": "^2.6.0",
- "broccoli-babel-transpiler": "^7.4.0",
- "broccoli-file-creator": "^2.1.1",
+ "backburner.js": "^2.7.0",
+ "broccoli-babel-transpiler": "^7.8.1",
"broccoli-persistent-filter": "^2.3.1",
"broccoli-plugin": "^4.0.3",
"broccoli-rollup": "^2.1.1",
- "broccoli-source": "^3.0.0",
+ "broccoli-source": "^3.0.1",
"broccoli-string-replace": "^0.1.2",
- "broccoli-typescript-compiler": "^4.2.0",
- "broccoli-uglify-sourcemap": "^3.2.0",
- "common-tags": "^1.8.0",
- "core-js": "^2.6.5",
+ "broccoli-typescript-compiler": "^8.0.0",
+ "broccoli-uglify-sourcemap": "^4.0.0",
+ "common-tags": "^1.8.2",
"dag-map": "^2.0.2",
- "ember-cli": "^3.12.0",
+ "ember-cli": "^4.10.0",
"ember-cli-blueprint-test-helpers": "^0.19.2",
- "ember-cli-browserstack": "^1.0.1",
- "ember-cli-dependency-checker": "^3.2.0",
+ "ember-cli-browserstack": "^2.0.1",
+ "ember-cli-dependency-checker": "^3.3.1",
"ember-cli-yuidoc": "^0.9.1",
"ember-publisher": "0.0.7",
- "eslint": "^6.8.0",
- "eslint-config-prettier": "^6.11.0",
- "eslint-import-resolver-node": "^0.3.3",
+ "eslint": "^8.29.0",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-disable-features": "^0.1.3",
- "eslint-plugin-ember-internal": "^1.1.1",
- "eslint-plugin-import": "^2.20.2",
+ "eslint-plugin-ember-internal": "^3.0.0",
+ "eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
- "eslint-plugin-prettier": "^3.1.3",
- "eslint-plugin-qunit": "^4.0.0",
- "execa": "^2.0.4",
- "express": "^4.17.1",
+ "eslint-plugin-prettier": "^4.2.1",
+ "eslint-plugin-qunit": "^7.3.4",
+ "execa": "^5.1.1",
+ "expect-type": "^0.15.0",
+ "express": "^4.18.2",
"finalhandler": "^1.1.2",
- "fs-extra": "^9.0.0",
+ "fs-extra": "^11.1.0",
"git-repo-info": "^2.1.1",
"github": "^0.2.3",
- "glob": "^7.1.4",
+ "glob": "^8.0.3",
"html-differ": "^1.4.0",
"lodash.uniq": "^4.5.0",
- "mkdirp": "^1.0.4",
- "mocha": "^7.1.2",
- "prettier": "^1.18.2",
- "puppeteer": "^3.0.4",
- "qunit": "^2.10.0",
- "rollup-plugin-commonjs": "^9.3.4",
+ "mkdirp": "^2.1.3",
+ "mocha": "^10.1.0",
+ "npm-run-all": "^4.1.5",
+ "prettier": "^2.8.0",
+ "puppeteer": "^19.4.1",
+ "qunit": "^2.19.1",
+ "recast": "^0.21.5",
+ "rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^4.2.4",
"route-recognizer": "^0.3.4",
- "router_js": "^6.2.5",
+ "router_js": "^8.0.3",
"rsvp": "^4.8.5",
- "serve-static": "^1.14.1",
+ "serve-static": "^1.14.2",
"simple-dom": "^1.4.0",
- "testem": "^3.1.0",
- "testem-failure-only-reporter": "^0.0.1",
- "tslint": "^5.20.1"
+ "testem": "^3.10.1",
+ "testem-failure-only-reporter": "^1.0.0",
+ "typescript": "4.9"
+ },
+ "peerDependencies": {
+ "@glimmer/component": "^1.1.2"
},
"engines": {
- "node": "10.* || >= 12.*"
+ "node": ">= 14.*"
},
"ember-addon": {
"after": "ember-cli-legacy-blueprints"
+ },
+ "typesVersions": {
+ "*": {
+ "types": [
+ "types/stable"
+ ],
+ "types/preview": [
+ "types/preview"
+ ]
+ }
}
}
diff --git a/packages/@ember/-internals/bootstrap/index.ts b/packages/@ember/-internals/bootstrap/index.ts
new file mode 100644
index 00000000000..adabe9c4f8b
--- /dev/null
+++ b/packages/@ember/-internals/bootstrap/index.ts
@@ -0,0 +1,8 @@
+import require from 'require';
+
+(function bootstrap() {
+ // Bootstrap Node module
+ if (typeof module === 'object' && typeof module.require === 'function') {
+ module.exports = require('ember').default;
+ }
+})();
diff --git a/packages/@ember/-internals/browser-environment/index.ts b/packages/@ember/-internals/browser-environment/index.ts
index 4a6a3c68b62..0b8c320bd3d 100644
--- a/packages/@ember/-internals/browser-environment/index.ts
+++ b/packages/@ember/-internals/browser-environment/index.ts
@@ -1,11 +1,12 @@
import hasDom from './lib/has-dom';
-declare const InstallTrigger: any;
+declare const chrome: unknown;
+declare const opera: unknown;
export { default as hasDOM } from './lib/has-dom';
export const window = hasDom ? self : null;
export const location = hasDom ? self.location : null;
export const history = hasDom ? self.history : null;
export const userAgent = hasDom ? self.navigator.userAgent : 'Lynx (textmode)';
-export const isChrome = hasDom ? Boolean((window as any).chrome) && !(window as any).opera : false;
-export const isFirefox = hasDom ? typeof InstallTrigger !== 'undefined' : false;
+export const isChrome = hasDom ? typeof chrome === 'object' && !(typeof opera === 'object') : false;
+export const isFirefox = hasDom ? /Firefox|FxiOS/.test(userAgent) : false;
diff --git a/packages/@ember/-internals/browser-environment/lib/has-dom.ts b/packages/@ember/-internals/browser-environment/lib/has-dom.ts
index e5ae0a12405..0360db0bd8e 100644
--- a/packages/@ember/-internals/browser-environment/lib/has-dom.ts
+++ b/packages/@ember/-internals/browser-environment/lib/has-dom.ts
@@ -1,7 +1,7 @@
// check if window exists and actually is the global
export default typeof self === 'object' &&
self !== null &&
- (self as any).Object === Object &&
+ self.Object === Object &&
typeof Window !== 'undefined' &&
self.constructor === Window &&
typeof document === 'object' &&
diff --git a/packages/@ember/-internals/console/index.d.ts b/packages/@ember/-internals/console/index.d.ts
deleted file mode 100644
index 440243f64c3..00000000000
--- a/packages/@ember/-internals/console/index.d.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-declare const Logger: {
- log(...args: any[]): void;
- warn(...args: any[]): void;
- error(...args: any[]): void;
- info(...args: any[]): void;
- debug(...args: any[]): void;
- assert(...args: any[]): void;
-};
-
-export default Logger;
diff --git a/packages/@ember/-internals/console/index.js b/packages/@ember/-internals/console/index.js
deleted file mode 100644
index a5d8b83e57a..00000000000
--- a/packages/@ember/-internals/console/index.js
+++ /dev/null
@@ -1,177 +0,0 @@
-import { deprecate } from '@ember/debug';
-import { LOGGER } from '@ember/deprecated-features';
-
-// Deliver message that the function is deprecated
-
-const DEPRECATION_MESSAGE = 'Use of Ember.Logger is deprecated. Please use `console` for logging.';
-const DEPRECATION_ID = 'ember-console.deprecate-logger';
-const DEPRECATION_URL =
- 'https://emberjs.com/deprecations/v3.x#toc_use-console-rather-than-ember-logger';
-/**
- @module ember
-*/
-
-/**
- Inside Ember-Metal, simply uses the methods from `imports.console`.
- Override this to provide more robust logging functionality.
-
- @class Logger
- @deprecated Use 'console' instead
-
- @namespace Ember
- @public
-*/
-let DEPRECATED_LOGGER;
-
-if (LOGGER) {
- DEPRECATED_LOGGER = {
- /**
- Logs the arguments to the console.
- You can pass as many arguments as you want and they will be joined together with a space.
-
- ```javascript
- var foo = 1;
- Ember.Logger.log('log value of foo:', foo);
- // "log value of foo: 1" will be printed to the console
- ```
-
- @method log
- @for Ember.Logger
- @param {*} arguments
- @public
- */
- log() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- return console.log(...arguments); // eslint-disable-line no-console
- },
-
- /**
- Prints the arguments to the console with a warning icon.
- You can pass as many arguments as you want and they will be joined together with a space.
-
- ```javascript
- Ember.Logger.warn('Something happened!');
- // "Something happened!" will be printed to the console with a warning icon.
- ```
-
- @method warn
- @for Ember.Logger
- @param {*} arguments
- @public
- */
- warn() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- return console.warn(...arguments); // eslint-disable-line no-console
- },
-
- /**
- Prints the arguments to the console with an error icon, red text and a stack trace.
- You can pass as many arguments as you want and they will be joined together with a space.
-
- ```javascript
- Ember.Logger.error('Danger! Danger!');
- // "Danger! Danger!" will be printed to the console in red text.
- ```
-
- @method error
- @for Ember.Logger
- @param {*} arguments
- @public
- */
- error() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- return console.error(...arguments); // eslint-disable-line no-console
- },
-
- /**
- Logs the arguments to the console.
- You can pass as many arguments as you want and they will be joined together with a space.
-
- ```javascript
- var foo = 1;
- Ember.Logger.info('log value of foo:', foo);
- // "log value of foo: 1" will be printed to the console
- ```
-
- @method info
- @for Ember.Logger
- @param {*} arguments
- @public
- */
- info() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- return console.info(...arguments); // eslint-disable-line no-console
- },
-
- /**
- Logs the arguments to the console in blue text.
- You can pass as many arguments as you want and they will be joined together with a space.
-
- ```javascript
- var foo = 1;
- Ember.Logger.debug('log value of foo:', foo);
- // "log value of foo: 1" will be printed to the console
- ```
-
- @method debug
- @for Ember.Logger
- @param {*} arguments
- @public
- */
- debug() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- /* eslint-disable no-console */
- if (console.debug) {
- return console.debug(...arguments);
- }
- return console.info(...arguments);
- /* eslint-enable no-console */
- },
-
- /**
- If the value passed into `Ember.Logger.assert` is not truthy it will throw an error with a stack trace.
-
- ```javascript
- Ember.Logger.assert(true); // undefined
- Ember.Logger.assert(true === false); // Throws an Assertion failed error.
- Ember.Logger.assert(true === false, 'Something invalid'); // Throws an Assertion failed error with message.
- ```
-
- @method assert
- @for Ember.Logger
- @param {Boolean} bool Value to test
- @param {String} message Assertion message on failed
- @public
- */
- assert() {
- deprecate(DEPRECATION_MESSAGE, false, {
- id: DEPRECATION_ID,
- until: '4.0.0',
- url: DEPRECATION_URL,
- });
- return console.assert(...arguments); // eslint-disable-line no-console
- },
- };
-}
-
-export default DEPRECATED_LOGGER;
diff --git a/packages/@ember/-internals/container/index.ts b/packages/@ember/-internals/container/index.ts
index 76660ceb27a..21bdd054ef2 100644
--- a/packages/@ember/-internals/container/index.ts
+++ b/packages/@ember/-internals/container/index.ts
@@ -5,5 +5,5 @@ The public API, specified on the application namespace should be considered the
@private
*/
-export { default as Registry, privatize } from './lib/registry';
-export { default as Container, FACTORY_FOR } from './lib/container';
+export { default as Registry, ResolverClass, privatize } from './lib/registry';
+export { default as Container, getFactoryFor, setFactoryFor, INIT_FACTORY } from './lib/container';
diff --git a/packages/@ember/-internals/container/lib/container.ts b/packages/@ember/-internals/container/lib/container.ts
index 63d1ae55ae7..3647776e505 100644
--- a/packages/@ember/-internals/container/lib/container.ts
+++ b/packages/@ember/-internals/container/lib/container.ts
@@ -1,24 +1,23 @@
-import { Factory, LookupOptions, Owner, OWNER, setOwner } from '@ember/-internals/owner';
-import { dictionary, HAS_NATIVE_PROXY } from '@ember/-internals/utils';
-import { EMBER_MODULE_UNIFICATION } from '@ember/canary-features';
+import type {
+ InternalFactory,
+ FactoryClass,
+ InternalOwner,
+ RegisterOptions,
+ FactoryManager,
+ FullName,
+} from '@ember/-internals/owner';
+import { setOwner } from '@ember/-internals/owner';
+import { dictionary } from '@ember/-internals/utils';
import { assert } from '@ember/debug';
-import { assign } from '@ember/polyfills';
import { DEBUG } from '@glimmer/env';
-import Registry, { DebugRegistry, Injection } from './registry';
-
-declare global {
- export function gc(): void;
-}
+import type { DebugRegistry } from './registry';
+import type Registry from './registry';
interface LeakTracking {
hasContainers(): boolean;
reset(): void;
}
-interface CacheMember {
- destroy?: () => void;
-}
-
let leakTracking: LeakTracking;
let containers: WeakSet;
if (DEBUG) {
@@ -33,6 +32,7 @@ if (DEBUG) {
containers = new WeakSet();
return {
hasContainers() {
+ // @ts-expect-error We just checked if it is definied
gc();
return GetWeakSetValues(containers).length > 0;
},
@@ -51,9 +51,9 @@ if (DEBUG) {
}
export interface ContainerOptions {
- owner?: Owner;
- cache?: { [key: string]: CacheMember };
- factoryManagerCache?: { [key: string]: FactoryManager };
+ owner?: InternalOwner;
+ cache?: { [key: string]: object };
+ factoryManagerCache?: { [key: string]: InternalFactoryManager };
validationCache?: { [key: string]: boolean };
}
@@ -73,10 +73,10 @@ export interface ContainerOptions {
export default class Container {
static _leakTracking: LeakTracking;
- readonly owner: Owner | null;
+ readonly owner: InternalOwner | null;
readonly registry: Registry & DebugRegistry;
- cache: { [key: string]: CacheMember };
- factoryManagerCache!: { [key: string]: FactoryManager };
+ cache: { [key: string]: object };
+ factoryManagerCache!: { [key: string]: InternalFactoryManager