Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettier v3 #820

Merged
merged 2 commits into from
Oct 11, 2023
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-ember": "^11.11.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-qunit": "^8.0.1",
"field-guide": "^2.4.0",
"field-guide-default-template": "^3.0.0",
"loader.js": "^4.7.0",
"prember": "^2.0.0",
"prettier": "^2.8.8",
"prettier": "^3.0.3",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
"release-it": "^15.11.0",
Expand Down
26 changes: 13 additions & 13 deletions tests/integration/modifiers/did-resize-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ module('Integration | Modifier | did-resize', function (hooks) {
assert.strictEqual(
Object.keys(options).length,
0,
'empty object passed as default options'
'empty object passed as default options',
);
});

test('modifier triggers handler when ResizeObserver fires callback', async function (assert) {
await render(
hbs`<div id="test-element" {{did-resize this.resizeStub}}></div>`
hbs`<div id="test-element" {{did-resize this.resizeStub}}></div>`,
);
let entry = { target: find('#test-element') };
let fakeObserver = { observe: {} };
Expand All @@ -70,7 +70,7 @@ module('Integration | Modifier | did-resize', function (hooks) {

assert.ok(
this.resizeStub.calledOnceWith(entry, fakeObserver),
'handler fired with correct parameters'
'handler fired with correct parameters',
);
});

Expand Down Expand Up @@ -114,13 +114,13 @@ module('Integration | Modifier | did-resize', function (hooks) {
await render(
hbs`<div id="test-element1" {{did-resize this.resizeStub}}></div>
<div id="test-element2" {{did-resize this.resizeStub2}}></div>
<div id="test-element3" {{did-resize this.resizeStub3}}></div>`
<div id="test-element3" {{did-resize this.resizeStub3}}></div>`,
);

let entries = ['#test-element1', '#test-element2', '#test-element3'].map(
(elementId) => {
return { target: find(elementId) };
}
},
);
let fakeObserver = { observe: {} };

Expand All @@ -130,47 +130,47 @@ module('Integration | Modifier | did-resize', function (hooks) {
assert.ok(this.resizeStub.calledOnce, 'First handler was called only once');
assert.ok(
this.resizeStub2.calledOnce,
'Second handler was called only once'
'Second handler was called only once',
);
assert.ok(
this.resizeStub3.calledOnce,
'Third handler was called only once'
'Third handler was called only once',
);

// trigger resize only on the first element
resizeCallback([entries[0]], fakeObserver);
assert.ok(
this.resizeStub.calledTwice,
'First handler was called a second time'
'First handler was called a second time',
);
assert.notOk(
this.resizeStub2.calledTwice,
'Second handler was not called a second time'
'Second handler was not called a second time',
);
assert.notOk(
this.resizeStub3.calledTwice,
'Third handler was not called a second time'
'Third handler was not called a second time',
);
});

test('element gets unobserved before removing from the DOM', async function (assert) {
await render(
hbs`<div id='test-element' {{did-resize this.resizeStub}}></div>`
hbs`<div id='test-element' {{did-resize this.resizeStub}}></div>`,
);
let element = find('#test-element');
await clearRender();

assert.ok(
unobserveStub.calledOnceWith(element),
'unobserve is called with the HTMLElement of the modifier'
'unobserve is called with the HTMLElement of the modifier',
);

let entry = { target: element };
let fakeObserver = { observe: {} };
resizeCallback([entry], fakeObserver);
assert.notOk(
this.resizeStub.called,
'handler function is not called after element is removed from the DOM'
'handler function is not called after element is removed from the DOM',
);
});
});
40 changes: 33 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1935,6 +1935,18 @@
dependencies:
"@octokit/openapi-types" "^18.0.0"

"@pkgr/utils@^2.3.1":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.4.2.tgz#9e638bbe9a6a6f165580dc943f138fd3309a2cbc"
integrity sha512-POgTXhjrTfbTV63DiFXav4lBHiICLKKwDeaKn9Nphwj7WH6m0hMMCaJkMyRWjgtPFyRKRVoMXXjczsTQRDEhYw==
dependencies:
cross-spawn "^7.0.3"
fast-glob "^3.3.0"
is-glob "^4.0.3"
open "^9.1.0"
picocolors "^1.0.0"
tslib "^2.6.0"

"@pnpm/network.ca-file@^1.0.1":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz#2ab05e09c1af0cdf2fcf5035bea1484e222f7983"
Expand Down Expand Up @@ -6811,12 +6823,13 @@ eslint-plugin-node@^11.1.0:
resolve "^1.10.1"
semver "^6.1.0"

eslint-plugin-prettier@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b"
integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==
eslint-plugin-prettier@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz#a3b399f04378f79f066379f544e42d6b73f11515"
integrity sha512-m3u5RnR56asrwV/lDC4GHorlW75DsFfmUcjfCYylTUs85dBRnB7VM6xG8eCMJdeDRnppzmxZVf1GEPJvl1JmNg==
dependencies:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.5"

eslint-plugin-qunit@^8.0.1:
version "8.0.1"
Expand Down Expand Up @@ -11161,7 +11174,7 @@ onetime@^6.0.0:
dependencies:
mimic-fn "^4.0.0"

[email protected]:
[email protected], open@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/open/-/open-9.1.0.tgz#684934359c90ad25742f5a26151970ff8c6c80b6"
integrity sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==
Expand Down Expand Up @@ -11794,11 +11807,16 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.5.1, prettier@^2.8.8:
prettier@^2.5.1:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==

prettier@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643"
integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==

pretty-ms@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.2.0.tgz#87a8feaf27fc18414d75441467d411d6e6098a25"
Expand Down Expand Up @@ -13629,6 +13647,14 @@ sync-disk-cache@^2.0.0:
rimraf "^3.0.0"
username-sync "^1.0.2"

synckit@^0.8.5:
version "0.8.5"
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.5.tgz#b7f4358f9bb559437f9f167eb6bc46b3c9818fa3"
integrity sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==
dependencies:
"@pkgr/utils" "^2.3.1"
tslib "^2.5.0"

tap-parser@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-7.0.0.tgz#54db35302fda2c2ccc21954ad3be22b2cba42721"
Expand Down Expand Up @@ -14008,7 +14034,7 @@ tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.2.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

tslib@^2.4.1:
tslib@^2.4.1, tslib@^2.5.0, tslib@^2.6.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
Expand Down
Loading