Skip to content

Commit

Permalink
Merge pull request #20116 from bertdeblock/consistent-determination-o…
Browse files Browse the repository at this point in the history
…f-module-prefix-in-blueprints
  • Loading branch information
kategengler authored Jun 12, 2022
2 parents 92e79ab + 326497b commit b85ccee
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>', function () {
Expand Down
5 changes: 2 additions & 3 deletions blueprints/initializer-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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');

module.exports = useTestFrameworkDetector({
Expand All @@ -29,10 +29,9 @@ module.exports = useTestFrameworkDetector({
},

locals: function (options) {
let modulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);
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')
),
Expand Down
6 changes: 2 additions & 4 deletions blueprints/instance-initializer-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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');

module.exports = useTestFrameworkDetector({
Expand All @@ -28,11 +28,9 @@ module.exports = useTestFrameworkDetector({
};
},
locals: function (options) {
let modulePrefix = stringUtils.dasherize(options.project.config().modulePrefix);

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')
),
Expand Down
4 changes: 2 additions & 2 deletions blueprints/util-test/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'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');

module.exports = useTestFrameworkDetector({
Expand All @@ -30,7 +30,7 @@ module.exports = useTestFrameworkDetector({
locals: function (options) {
return {
friendlyTestName: ['Unit', 'Utility', options.entity.name].join(' | '),
dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix),
modulePrefix: modulePrefixForProject(options.project),
};
},
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import <%= camelizedModuleName %> from '<%= dasherizedModulePrefix %>/utils/<%= dasherizedModuleName %>';
import <%= camelizedModuleName %> from '<%= modulePrefix %>/utils/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';

module('<%= friendlyTestName %>', function () {
Expand Down

0 comments on commit b85ccee

Please sign in to comment.