Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export default [
'**/babel.test.config.mjs',
'node-tests/**/*.js',
'tests/node/**/*.js',
'smoke-tests/node-template/**/*.js',
'blueprints/**/*.js',
'bin/**/*.js',
'bin/**/*.mjs',
Expand Down Expand Up @@ -244,6 +245,7 @@ export default [
'**/babel.test.config.mjs',
'node-tests/**/*.js',
'tests/node/**/*.js',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prob the tests/node lines can drop?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a utils test (the buildinfo) still in there --- it tests are infra rather than the behavior of ember-source, so I guess it still makes sense to have there -- your earlier gut feeling was good

'smoke-tests/node-template/**/*.js',
'blueprints/**/*.js',
'bin/**/*.js',
'bin/**/*.mjs',
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"github": "^0.2.3",
"glob": "^8.0.3",
"globals": "^16.0.0",
"html-differ": "^1.4.0",
"kill-port-process": "^3.2.1",
"mocha": "^10.2.0",
"node-gzip": "^1.1.2",
Expand All @@ -144,7 +143,6 @@
"resolve.exports": "^2.0.3",
"rollup": "^4.57.1",
"rsvp": "^4.8.5",
"simple-dom": "^1.4.0",
"table": "^6.9.0",
"terser": "^5.42.0",
"testem": "^3.10.1",
Expand Down Expand Up @@ -390,4 +388,4 @@
}
},
"packageManager": "[email protected]"
}
}
24 changes: 18 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions smoke-tests/node-template/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "ember-test-node-template",
"version": "0.0.0",
"private": true,
"description": "Node-focused smoke test template for ember-source",
"scripts": {
"test:node": "qunit tests/node/**/*-test.js"
},
"dependencies": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can any deps move out of the main package.json?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then linked via scenario? or?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thought there might be test-only deps able to be moved into this package.json from the root

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see -- i'll check

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found 2

"git-repo-info": "^2.1.1",
"html-differ": "^1.4.0",
"qunit": "^2.20.1",
"semver": "^7.6.0",
"simple-dom": "^1.4.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');
const distPath = path.join(__dirname, '../../../dist');

const emberSourceRoot = path.dirname(require.resolve('ember-source/package.json'));
const distPath = path.join(emberSourceRoot, 'dist');
const emberPath = path.join(distPath, 'ember.debug.js');
const templateCompilerPath = path.join(distPath, 'ember-template-compiler');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

const path = require('path');
const emberSourceRoot = path.dirname(require.resolve('ember-source/package.json'));
const Project = require('./fixtures/project');
const Overrides = require('../../lib/overrides');
const Overrides = require(path.join(emberSourceRoot, 'lib', 'overrides'));

function cmp(a, b) {
if (a == undefined || a < b) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const fs = require('fs');
const path = require('path');

const emberSourceRoot = path.dirname(require.resolve('ember-source/package.json'));

QUnit.module('sourcemap validation', function () {
QUnit.test(`ember.js has only a single sourcemaps comment`, function (assert) {
let jsPath = `dist/ember.debug.js`;
let jsPath = path.join(emberSourceRoot, 'dist', 'ember.debug.js');
assert.ok(fs.existsSync(jsPath));

let contents = fs.readFileSync(jsPath, 'utf-8');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');

const distPath = path.join(__dirname, '../../dist');
const emberSourceRoot = path.dirname(require.resolve('ember-source/package.json'));
const distPath = path.join(emberSourceRoot, 'dist');

let templateCompiler;

Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions smoke-tests/scenarios/node-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { nodeScenarios } from './scenarios';
import type { PreparedApp, Scenarios } from 'scenario-tester';
import * as QUnit from 'qunit';

const { module: Qmodule, test } = QUnit;
QUnit.config.testTimeout = 120_000;

function nodeTests(scenarios: Scenarios) {
scenarios
.map('node-tests', (_project) => {})
.forEachScenario((scenario) => {
Qmodule(scenario.name, function (hooks) {
let app: PreparedApp;

hooks.before(async () => {
app = await scenario.prepare();
});

test('node tests', async function (assert) {
let result = await app.execute(`pnpm test:node`);
assert.equal(result.exitCode, 0, result.output);
});
});
});
}

nodeTests(nodeScenarios);
14 changes: 14 additions & 0 deletions smoke-tests/scenarios/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,17 @@ export const v2AppScenarios = Scenarios.fromProject(() =>
).expand({
embroiderVite,
});

function node(project: Project) {
project.linkDevDependency('ember-source', {
baseDir: dirname(require.resolve('../app-template/package.json')),
});
}

export const nodeScenarios = Scenarios.fromProject(() =>
Project.fromDir(dirname(require.resolve('../node-template/package.json')), {
linkDevDeps: true,
})
).expand({
node,
});