diff --git a/packages/util/ember-cli-build.js b/packages/util/ember-cli-build.js index 2c20af8b8..ba0649dc9 100644 --- a/packages/util/ember-cli-build.js +++ b/packages/util/ember-cli-build.js @@ -1,7 +1,6 @@ 'use strict'; const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); -const { maybeEmbroider } = require('@embroider/test-setup'); module.exports = function (defaults) { let app = new EmberAddon(defaults, { @@ -15,13 +14,5 @@ module.exports = function (defaults) { behave. You most likely want to be modifying `./index.js` or app's build file */ - return maybeEmbroider(app, { - staticAddonTrees: true, - staticAddonTestSupportTrees: true, - skipBabel: [ - { - package: 'qunit', - }, - ], - }); + return app.toTree(); }; diff --git a/packages/util/package.json b/packages/util/package.json index 76df06ad2..778ef92d6 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -94,7 +94,7 @@ "webpack": "^5.74.0" }, "engines": { - "node": "14.* || >= 16" + "node": "12.* || 14.* || >= 16" }, "ember": { "edition": "octane" diff --git a/tests/scenarios/util-test.ts b/tests/scenarios/util-test.ts index f39a636e3..78ceba48f 100644 --- a/tests/scenarios/util-test.ts +++ b/tests/scenarios/util-test.ts @@ -7,7 +7,26 @@ import { dirname } from 'path'; const { module: Qmodule, test } = QUnit; supportMatrix(Scenarios.fromDir(dirname(require.resolve('@embroider/util/package.json')))) - .map('util', () => {}) + .only('lts_3_28') + .map('util', project => { + project.mergeFiles({ + '.npmrc': 'use-node-version=12.22.1', + 'test.js': ` + const { module: QModule, test } = require("qunit"); + const semver = require("semver"); + const { PackageCache } = require("@embroider/shared-internals"); + + QModule("shared-internals", function () { + test("testing on node 12", function (assert) { + assert.ok( + semver.satisfies(process.version, "^12.0.0"), + \`\${process.version} should be what we expected\` + ); + }); + }); + `, + }); + }) .forEachScenario(scenario => { Qmodule(scenario.name, function (hooks) { let app: PreparedApp; @@ -15,6 +34,11 @@ supportMatrix(Scenarios.fromDir(dirname(require.resolve('@embroider/util/package app = await scenario.prepare(); }); + test('verify node version', async function (assert) { + let result = await app.execute(`pnpm ./node_modules/qunit/bin/qunit.js ./test.js`); + assert.equal(result.exitCode, 0, result.output); + }); + test(`pnpm test:ember`, async function (assert) { let result = await app.execute('pnpm test:ember'); assert.equal(result.exitCode, 0, result.output);