mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
refactor: fix more type-aware linting errors (#7479)
This commit is contained in:
parent
bf1513a3e3
commit
624735bd92
51 changed files with 192 additions and 189 deletions
|
@ -37,21 +37,24 @@ describe('isNameTooLong', () => {
|
|||
};
|
||||
const oldProcessPlatform = process.platform;
|
||||
Object.defineProperty(process, 'platform', {value: 'darwin'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(isNameTooLong(file)).toBe(
|
||||
typeof asserts[file] === 'boolean' ? asserts[file] : asserts[file].apfs,
|
||||
typeof expected === 'boolean' ? expected : expected.apfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: 'win32'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(isNameTooLong(file)).toBe(
|
||||
typeof asserts[file] === 'boolean' ? asserts[file] : asserts[file].apfs,
|
||||
typeof expected === 'boolean' ? expected : expected.apfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: 'android'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(isNameTooLong(file)).toBe(
|
||||
typeof asserts[file] === 'boolean' ? asserts[file] : asserts[file].xfs,
|
||||
typeof expected === 'boolean' ? expected : expected.xfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: oldProcessPlatform});
|
||||
|
@ -79,21 +82,24 @@ describe('shortName', () => {
|
|||
};
|
||||
const oldProcessPlatform = process.platform;
|
||||
Object.defineProperty(process, 'platform', {value: 'darwin'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(shortName(file)).toBe(
|
||||
typeof asserts[file] === 'string' ? asserts[file] : asserts[file].apfs,
|
||||
typeof expected === 'string' ? expected : expected.apfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: 'win32'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(shortName(file)).toBe(
|
||||
typeof asserts[file] === 'string' ? asserts[file] : asserts[file].apfs,
|
||||
typeof expected === 'string' ? expected : expected.apfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: 'android'});
|
||||
Object.keys(asserts).forEach((file) => {
|
||||
(Object.keys(asserts) as (keyof typeof asserts)[]).forEach((file) => {
|
||||
const expected = asserts[file];
|
||||
expect(shortName(file)).toBe(
|
||||
typeof asserts[file] === 'string' ? asserts[file] : asserts[file].xfs,
|
||||
typeof expected === 'string' ? expected : expected.xfs,
|
||||
);
|
||||
});
|
||||
Object.defineProperty(process, 'platform', {value: oldProcessPlatform});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue