diff --git a/tests/migration/ember-addon/steps/create-options/customizations.test.js b/tests/migration/ember-addon/steps/create-options/customizations.test.js index cfa229d1..b3b5e8dd 100644 --- a/tests/migration/ember-addon/steps/create-options/customizations.test.js +++ b/tests/migration/ember-addon/steps/create-options/customizations.test.js @@ -1,19 +1,13 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/customizations.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > customizations', function () { - const codemodOptions = { - addonLocation: 'packages/new-v1-addon', - projectRoot: 'tmp/new-v1-addon-customizations', - testAppLocation: 'demo-app', - testAppName: 'demo-app-for-new-v1-addon', - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', dependencies: { 'ember-cli-babel': '^7.26.11', 'ember-cli-htmlbars': '^6.1.1', @@ -33,7 +27,7 @@ test('migration | ember-addon | steps | create-options > customizations', functi assert.deepEqual(createOptions(codemodOptions), { locations: { - addon: 'packages/new-v1-addon', + addon: 'packages/ember-container-query', testApp: 'demo-app', }, packageManager: { @@ -50,13 +44,13 @@ test('migration | ember-addon | steps | create-options > customizations', functi hasGlint: false, hasTypeScript: false, isV1Addon: true, - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', }, testApp: { - name: 'demo-app-for-new-v1-addon', + name: 'demo-app-for-ember-container-query', }, }, - projectRoot: 'tmp/new-v1-addon-customizations', + projectRoot: 'tmp/ember-container-query-customizations', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-an-empty-file.test.js b/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-an-empty-file.test.js index 0b05f355..14d2f5ed 100644 --- a/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-an-empty-file.test.js +++ b/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-an-empty-file.test.js @@ -1,24 +1,18 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > error handling (package.json is an empty file)', function () { - const options = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': '', 'yarn.lock': '', }; - loadFixture(inputProject, options); + loadFixture(inputProject, codemodOptions); assert.throws( () => { - createOptions(options); + createOptions(codemodOptions); }, (error) => { assert.strictEqual( diff --git a/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-not-a-valid-json.test.js b/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-not-a-valid-json.test.js index a535add8..3957b7e5 100644 --- a/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-not-a-valid-json.test.js +++ b/tests/migration/ember-addon/steps/create-options/error-handling-package-json-is-not-a-valid-json.test.js @@ -1,14 +1,8 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > error handling (package.json is not a valid JSON)', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': '{\n "name": }', 'yarn.lock': '', diff --git a/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-missing.test.js b/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-missing.test.js index 00b8af74..2afed8e6 100644 --- a/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-missing.test.js +++ b/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-missing.test.js @@ -1,14 +1,8 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > error handling (package name is missing)', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': '{}', 'yarn.lock': '', diff --git a/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-not-valid.test.js b/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-not-valid.test.js index 08780c02..a7f2ad52 100644 --- a/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-not-valid.test.js +++ b/tests/migration/ember-addon/steps/create-options/error-handling-package-name-is-not-valid.test.js @@ -1,14 +1,8 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/scoped.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > error handling (package name is not valid)', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { diff --git a/tests/migration/ember-addon/steps/create-options/error-handling-package-version-is-missing.test.js b/tests/migration/ember-addon/steps/create-options/error-handling-package-version-is-missing.test.js index 90e00244..904cf98e 100644 --- a/tests/migration/ember-addon/steps/create-options/error-handling-package-version-is-missing.test.js +++ b/tests/migration/ember-addon/steps/create-options/error-handling-package-version-is-missing.test.js @@ -1,18 +1,12 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > error handling (package version is missing)', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', + name: 'ember-container-query', }, null, 2 diff --git a/tests/migration/ember-addon/steps/create-options/glint.test.js b/tests/migration/ember-addon/steps/create-options/glint.test.js index 69e70f91..f3b4fd5f 100644 --- a/tests/migration/ember-addon/steps/create-options/glint.test.js +++ b/tests/migration/ember-addon/steps/create-options/glint.test.js @@ -1,19 +1,13 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/glint.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > glint', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-typescript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', dependencies: { 'ember-cli-babel': '^7.26.11', 'ember-cli-htmlbars': '^6.1.1', @@ -36,7 +30,7 @@ test('migration | ember-addon | steps | create-options > glint', function () { assert.deepEqual(createOptions(codemodOptions), { locations: { - addon: 'new-v1-addon', + addon: 'ember-container-query', testApp: 'test-app', }, packageManager: { @@ -55,13 +49,13 @@ test('migration | ember-addon | steps | create-options > glint', function () { hasGlint: true, hasTypeScript: true, isV1Addon: true, - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', }, testApp: { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-typescript', + projectRoot: 'tmp/ember-container-query-glint', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/javascript.test.js b/tests/migration/ember-addon/steps/create-options/javascript.test.js index 109e5708..122aac0a 100644 --- a/tests/migration/ember-addon/steps/create-options/javascript.test.js +++ b/tests/migration/ember-addon/steps/create-options/javascript.test.js @@ -1,19 +1,13 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > javascript', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', dependencies: { 'ember-cli-babel': '^7.26.11', 'ember-cli-htmlbars': '^6.1.1', @@ -33,7 +27,7 @@ test('migration | ember-addon | steps | create-options > javascript', function ( assert.deepEqual(createOptions(codemodOptions), { locations: { - addon: 'new-v1-addon', + addon: 'ember-container-query', testApp: 'test-app', }, packageManager: { @@ -50,13 +44,13 @@ test('migration | ember-addon | steps | create-options > javascript', function ( hasGlint: false, hasTypeScript: false, isV1Addon: true, - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', }, testApp: { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/ember-container-query-javascript', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/npm.test.js b/tests/migration/ember-addon/steps/create-options/npm.test.js index 2e8e030b..6711649f 100644 --- a/tests/migration/ember-addon/steps/create-options/npm.test.js +++ b/tests/migration/ember-addon/steps/create-options/npm.test.js @@ -4,7 +4,7 @@ import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > npm', function () { const codemodOptions = { addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/new-v1-addon-npm', testAppLocation: undefined, testAppName: undefined, }; @@ -57,6 +57,6 @@ test('migration | ember-addon | steps | create-options > npm', function () { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/new-v1-addon-npm', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/pnpm.test.js b/tests/migration/ember-addon/steps/create-options/pnpm.test.js index 6bc70ccc..4160e40d 100644 --- a/tests/migration/ember-addon/steps/create-options/pnpm.test.js +++ b/tests/migration/ember-addon/steps/create-options/pnpm.test.js @@ -4,7 +4,7 @@ import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > pnpm', function () { const codemodOptions = { addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/new-v1-addon-pnpm', testAppLocation: undefined, testAppName: undefined, }; @@ -57,6 +57,6 @@ test('migration | ember-addon | steps | create-options > pnpm', function () { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/new-v1-addon-pnpm', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/typescript.test.js b/tests/migration/ember-addon/steps/create-options/typescript.test.js index a9031178..83520c7e 100644 --- a/tests/migration/ember-addon/steps/create-options/typescript.test.js +++ b/tests/migration/ember-addon/steps/create-options/typescript.test.js @@ -1,19 +1,13 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/typescript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > typescript', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-typescript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', dependencies: { 'ember-cli-babel': '^7.26.11', 'ember-cli-htmlbars': '^6.1.1', @@ -35,7 +29,7 @@ test('migration | ember-addon | steps | create-options > typescript', function ( assert.deepEqual(createOptions(codemodOptions), { locations: { - addon: 'new-v1-addon', + addon: 'ember-container-query', testApp: 'test-app', }, packageManager: { @@ -53,13 +47,13 @@ test('migration | ember-addon | steps | create-options > typescript', function ( hasGlint: false, hasTypeScript: true, isV1Addon: true, - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', }, testApp: { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-typescript', + projectRoot: 'tmp/ember-container-query-typescript', }); }); diff --git a/tests/migration/ember-addon/steps/create-options/v2-addon.test.js b/tests/migration/ember-addon/steps/create-options/v2-addon.test.js index 0b1e5b28..0ed92bde 100644 --- a/tests/migration/ember-addon/steps/create-options/v2-addon.test.js +++ b/tests/migration/ember-addon/steps/create-options/v2-addon.test.js @@ -1,21 +1,15 @@ import { createOptions } from '../../../../../src/migration/ember-addon/steps/index.js'; +import { codemodOptions } from '../../../../helpers/shared-test-setups/javascript.js'; import { assert, loadFixture, test } from '../../../../helpers/testing.js'; test('migration | ember-addon | steps | create-options > v2 addon', function () { - const codemodOptions = { - addonLocation: undefined, - projectRoot: 'tmp/new-v1-addon-javascript', - testAppLocation: undefined, - testAppName: undefined, - }; - const inputProject = { 'package.json': JSON.stringify( { - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', private: true, - workspaces: ['new-v1-addon', 'test-app'], + workspaces: ['ember-container-query', 'test-app'], }, null, 2 @@ -27,7 +21,7 @@ test('migration | ember-addon | steps | create-options > v2 addon', function () assert.deepEqual(createOptions(codemodOptions), { locations: { - addon: 'new-v1-addon', + addon: 'ember-container-query', testApp: 'test-app', }, packageManager: { @@ -41,13 +35,13 @@ test('migration | ember-addon | steps | create-options > v2 addon', function () hasGlint: false, hasTypeScript: false, isV1Addon: false, - name: 'new-v1-addon', - version: '0.0.0', + name: 'ember-container-query', + version: '3.2.0', }, testApp: { name: 'test-app', }, }, - projectRoot: 'tmp/new-v1-addon-javascript', + projectRoot: 'tmp/ember-container-query-javascript', }); });