From bf6e109a084e3abab18be4eb2d0c6097d72ae460 Mon Sep 17 00:00:00 2001 From: Travis Hoover Date: Thu, 24 Jun 2021 10:36:52 -0700 Subject: [PATCH 1/3] Convert sample-lib to new infra Additionally removing the old test-packages/sample-lib files --- test-packages/sample-lib/index.js | 3 --- test-packages/sample-lib/package.json | 5 ----- tests/scenarios/fastboot-app-test.ts | 21 ++++++++++++++------- tests/scenarios/package.json | 1 - yarn.lock | 3 --- 5 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 test-packages/sample-lib/index.js delete mode 100644 test-packages/sample-lib/package.json diff --git a/test-packages/sample-lib/index.js b/test-packages/sample-lib/index.js deleted file mode 100644 index d644e8bd3..000000000 --- a/test-packages/sample-lib/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function () { - return 'From sample-lib'; -} diff --git a/test-packages/sample-lib/package.json b/test-packages/sample-lib/package.json deleted file mode 100644 index 3848c7da3..000000000 --- a/test-packages/sample-lib/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@embroider/sample-lib", - "version": "0.0.0", - "license": "MIT" -} diff --git a/tests/scenarios/fastboot-app-test.ts b/tests/scenarios/fastboot-app-test.ts index d58a7bf85..6e57740fc 100644 --- a/tests/scenarios/fastboot-app-test.ts +++ b/tests/scenarios/fastboot-app-test.ts @@ -1,5 +1,5 @@ import { appScenarios } from './scenarios'; -import { PreparedApp } from 'scenario-tester'; +import { PreparedApp, Project } from 'scenario-tester'; import { setupFastboot } from './helpers'; import QUnit from 'qunit'; import merge from 'lodash/merge'; @@ -7,7 +7,14 @@ const { module: Qmodule, test } = QUnit; appScenarios .map('dynamic-import', project => { - project.linkDependency('@embroider/sample-lib', { baseDir: __dirname }); + let sampleLib = new Project('@embroider/sample-lib', '0.0.0'); + merge(sampleLib.files, { + 'index.js': `export default function () { + return 'From sample-lib'; + }`, + }); + + project.addDependency(sampleLib); project.linkDependency('ember-cli-fastboot', { baseDir: __dirname }); project.linkDependency('fastboot', { baseDir: __dirname }); project.linkDependency('fastboot-addon', { baseDir: __dirname }); @@ -264,12 +271,12 @@ appScenarios app = await scenario.prepare(); }); - ['production', 'development'].forEach(env => { - test(`yarn test: ${env}`, async function (assert) { - let result = await app.execute('yarn test'); - assert.equal(result.exitCode, 0, result.output); - }); + test(`yarn test`, async function (assert) { + let result = await app.execute('yarn test'); + assert.equal(result.exitCode, 0, result.output); + }); + ['production', 'development'].forEach(env => { Qmodule(`fastboot: ${env}`, function (hooks) { let visit: any; let doc: any; diff --git a/tests/scenarios/package.json b/tests/scenarios/package.json index 7ec00723a..9218fc75f 100644 --- a/tests/scenarios/package.json +++ b/tests/scenarios/package.json @@ -18,7 +18,6 @@ }, "license": "MIT", "devDependencies": { - "@embroider/sample-lib": "link:../../test-packages/sample-lib", "@embroider/macros": "0.42.2", "bootstrap": "^4.3.1", "broccoli-funnel": "^3.0.5", diff --git a/yarn.lock b/yarn.lock index ce3e5f2e9..10c196936 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1311,9 +1311,6 @@ resolve "^1.8.1" semver "^7.3.2" -"@embroider/sample-lib@link:test-packages/sample-lib": - version "0.0.0" - "@embroider/shared-internals@0.41.0": version "0.41.0" resolved "https://registry.yarnpkg.com/@embroider/shared-internals/-/shared-internals-0.41.0.tgz#2553f026d4f48ea1fd11235501feb63bf49fa306" From cabf0b8bce92a9ded5a39c9cef0b06a4441bcd41 Mon Sep 17 00:00:00 2001 From: Travis Hoover Date: Thu, 24 Jun 2021 10:38:33 -0700 Subject: [PATCH 2/3] dont change double test --- tests/scenarios/fastboot-app-test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/scenarios/fastboot-app-test.ts b/tests/scenarios/fastboot-app-test.ts index 6e57740fc..db8166298 100644 --- a/tests/scenarios/fastboot-app-test.ts +++ b/tests/scenarios/fastboot-app-test.ts @@ -271,12 +271,12 @@ appScenarios app = await scenario.prepare(); }); - test(`yarn test`, async function (assert) { - let result = await app.execute('yarn test'); - assert.equal(result.exitCode, 0, result.output); - }); - ['production', 'development'].forEach(env => { + test(`yarn test`, async function (assert) { + let result = await app.execute('yarn test'); + assert.equal(result.exitCode, 0, result.output); + }); + Qmodule(`fastboot: ${env}`, function (hooks) { let visit: any; let doc: any; From 9bbbfd69e41404d12fdfc472847228fb28dc1098 Mon Sep 17 00:00:00 2001 From: Travis Hoover Date: Thu, 24 Jun 2021 10:39:18 -0700 Subject: [PATCH 3/3] add back test title --- tests/scenarios/fastboot-app-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/scenarios/fastboot-app-test.ts b/tests/scenarios/fastboot-app-test.ts index db8166298..57e147210 100644 --- a/tests/scenarios/fastboot-app-test.ts +++ b/tests/scenarios/fastboot-app-test.ts @@ -272,7 +272,7 @@ appScenarios }); ['production', 'development'].forEach(env => { - test(`yarn test`, async function (assert) { + test(`yarn test: ${env}`, async function (assert) { let result = await app.execute('yarn test'); assert.equal(result.exitCode, 0, result.output); });