-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix updating fragment arrays multiple times in the same runloop (#487)
* run CI in production environment * upgrade ember-try Fixes the following error: Error: Cannot copy '../../../browserslist/cli.js' to a subdirectory of itself, '../../../browserslist/cli.js'. at /home/runner/work/ember-data-model-fragments/ember-data-model-fragments/node_modules/ember-try/node_modules/fs-extra/lib/copy/copy.js:210:21 at FSReqCallback.oncomplete (fs.js:180:23) ember-cli/ember-try#967 * upgrade to node.js 18 * fix store.find deprecation * replace assert.throws with expectAssertion * fix updating fragment array multiple times * revert to node 14 and use `yarn --ignore-engines`
- Loading branch information
Showing
11 changed files
with
98 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { getDebugFunction, setDebugFunction } from '@ember/debug'; | ||
import { DEBUG } from '@glimmer/env'; | ||
|
||
/** | ||
* Asserts that `Ember.assert` is called with a falsy condition | ||
* @param func function which calls `Ember.assert` | ||
* @param expectedMessage the expected assertion text to compare with the first argument to `Ember.assert` | ||
*/ | ||
function expectAssertion(func, expectedMessage) { | ||
if (!DEBUG) { | ||
this.ok(true, 'Assertions disabled in production builds'); | ||
return; | ||
} | ||
const originalAssertFunc = getDebugFunction('assert'); | ||
try { | ||
let called = false; | ||
let failed = false; | ||
let actualMessage; | ||
setDebugFunction('assert', function assert(desc, test) { | ||
called = true; | ||
if (!test) { | ||
failed = true; | ||
actualMessage = desc; | ||
} | ||
}); | ||
func(); | ||
this.true(called, `Expected Ember.assert to be called`); | ||
this.true(failed, `Expected Ember.assert to fail its test`); | ||
this.strictEqual( | ||
actualMessage, | ||
expectedMessage, | ||
'Expected Ember.assert message to match' | ||
); | ||
} finally { | ||
// restore original assert function | ||
setDebugFunction('assert', originalAssertFunc); | ||
} | ||
} | ||
|
||
export function setup(assert) { | ||
assert.expectAssertion = expectAssertion; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4728,20 +4728,21 @@ ember-try-config@^4.0.0: | |
remote-git-tags "^3.0.0" | ||
semver "^7.3.2" | ||
|
||
ember-try@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/ember-try/-/ember-try-2.0.0.tgz#2671c221f5a0335fa2c189d00db7146e2e72a1dd" | ||
integrity sha512-2N7Vic45sbAegA5fhdfDjVbEVS4r+ze+tTQs2/wkY+8fC5yAGHfCM5ocyoTfBN5m7EhznC3AyMsOy4hLPzHFSQ== | ||
ember-try@^3.0.0: | ||
version "3.0.0" | ||
resolved "https://registry.yarnpkg.com/ember-try/-/ember-try-3.0.0.tgz#3b4e8511b64925aff14224b408fb5b5adab69391" | ||
integrity sha512-ZYVKYWMnrHSD3vywo7rV76kPCOC9ATIEnGGG/PEKfCcFE0lB26jltRDnOrhORfLKq0JFp62fFxC/4940U+MwRQ== | ||
dependencies: | ||
chalk "^4.1.2" | ||
cli-table3 "^0.6.0" | ||
core-object "^3.1.5" | ||
debug "^4.3.2" | ||
ember-try-config "^4.0.0" | ||
execa "^4.1.0" | ||
fs-extra "^9.0.1" | ||
fs-extra "^6.0.1" | ||
resolve "^1.20.0" | ||
rimraf "^3.0.2" | ||
semver "^7.5.4" | ||
walk-sync "^2.2.0" | ||
|
||
emoji-regex@^7.0.1: | ||
|
@@ -5777,6 +5778,15 @@ fs-extra@^5.0.0: | |
jsonfile "^4.0.0" | ||
universalify "^0.1.0" | ||
|
||
fs-extra@^6.0.1: | ||
version "6.0.1" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" | ||
integrity sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA== | ||
dependencies: | ||
graceful-fs "^4.1.2" | ||
jsonfile "^4.0.0" | ||
universalify "^0.1.0" | ||
|
||
fs-extra@^7.0.0, fs-extra@^7.0.1: | ||
version "7.0.1" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" | ||
|
@@ -9849,6 +9859,13 @@ semver@^7.0.0, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve | |
dependencies: | ||
lru-cache "^6.0.0" | ||
|
||
semver@^7.5.4: | ||
version "7.6.0" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" | ||
integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== | ||
dependencies: | ||
lru-cache "^6.0.0" | ||
|
||
[email protected]: | ||
version "0.18.0" | ||
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" | ||
|