Skip to content

Commit

Permalink
[BUGFIX]: Fix errors while running yarn start (#7146)
Browse files Browse the repository at this point in the history
* [BUGFIX]: Fix errors while running yarn start

fix Safari test issue

Co-authored-by: Chris Thoburn <[email protected]>

* fix lint

* Change debug name to test-support

Co-authored-by: Chris Thoburn <[email protected]>
  • Loading branch information
2 people authored and igorT committed Jun 5, 2020
1 parent 09fc442 commit 404d89d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/-ember-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "ember build",
"build:production": "ember build --environment=production",
"start": "ember server",
"start": "ember serve",
"docs": "mkdir -p dist && ember ember-cli-yuidoc",
"test": "ember test",
"test:all": "ember try:each",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ module('@ember-data/model klass.modelName', function(hooks) {
assert.strictEqual(
startsWith(e.message, `Cannot assign to read only property 'modelName' of `) ||
// IE11 has a different message
startsWith(e.message, `Assignment to read-only properties is not allowed in strict mode`),
startsWith(e.message, `Assignment to read-only properties is not allowed in strict mode`) ||
// Safari aso has a different message
startsWith(e.message, `Attempted to assign to readonly property`),
true,
`modelName is immutable: ${e.message}`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DEBUG } from '@glimmer/env';

import { skip, test } from 'qunit';

import VERSION, { COMPAT_VERSION } from '@ember-data/unpublished-test-infra/version';
import VERSION, { COMPAT_VERSION } from '@ember-data/unpublished-test-infra/test-support/version';

// small comparison function for major and minor semver values
function gte(EDVersion, DeprecationVersion) {
Expand Down
16 changes: 8 additions & 8 deletions packages/unpublished-test-infra/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// eslint-disable-next-line node/no-unpublished-require
const merge = require('broccoli-merge-trees');
const version = require('@ember-data/private-build-infra/src/create-version-module');
const addonBuildConfigForDataPackage = require('@ember-data/private-build-infra/src/addon-build-config-for-data-package');

Expand All @@ -8,12 +9,11 @@ const name = require('./package').name;
const addonBaseConfig = addonBuildConfigForDataPackage(name);

module.exports = Object.assign({}, addonBaseConfig, {
treeForAddon() {
if (process.env.EMBER_CLI_TEST_COMMAND) {
const options = this.getEmberDataConfig();
let compatVersion = options.compatWith;
let tree = version(compatVersion);
return this.debugTree(this._super.treeForAddon.call(this, tree), 'addon-output');
}
treeForAddonTestSupport(existingTree) {
const options = this.getEmberDataConfig();
let compatVersion = options.compatWith;
let tree = merge([existingTree, version(compatVersion)]);

return this.debugTree(this._super.treeForAddonTestSupport.call(this, tree), 'test-support');
},
});
1 change: 1 addition & 0 deletions packages/unpublished-test-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"testem": "^3.0.3"
},
"devDependencies": {
"broccoli-merge-trees": "^4.2.0",
"@ember/optional-features": "^1.3.0",
"ember-cli": "~3.17.0",
"ember-cli-dependency-checker": "^3.2.0",
Expand Down

0 comments on commit 404d89d

Please sign in to comment.