Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add missing flow utils#201

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dominictobias wants to merge6 commits intojoarwilk:master
base:master
Choose a base branch
Loading
fromdominictobias:master
Open
Show file tree
Hide file tree
Changes from1 commit
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
PrevPrevious commit
NextNext commit
fix: snaps
  • Loading branch information
@dominictobias
dominictobias committedOct 4, 2023
commit8c4db6309803f55c8fd27e0b771a322c9702a4cf
26 changes: 0 additions & 26 deletionssrc/__tests__/__snapshots__/spread.spec.ts.snap
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,33 +20,7 @@ declare var combination: Foo & Bar;
"
`;

exports[`should not use spread when performing union of inexact object types 2`] = `
"declare type Foo = {
foo: number,
...
};
declare type Bar = {
bar: string,
...
};
declare var combination: Foo & Bar;
"
`;

exports[`should use spread when performing union of exact object types 1`] = `
"declare type Foo = {
foo: number,
...
};
declare type Bar = {
bar: string,
...
};
declare var combination: Foo & Bar;
"
`;

exports[`should use spread when performing union of exact object types 2`] = `
"declare type Foo = {|
foo: number,
|};
Expand Down
42 changes: 12 additions & 30 deletionssrc/__tests__/spread.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,21 +7,12 @@ type Foo = { foo: number };
type Bar = { bar: string };
const combination: Foo & Bar;
`;

{
const result = compiler.compileDefinitionString(ts, { quiet: true });
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
}

{
const result = compiler.compileDefinitionString(ts, {
quiet: true,
inexact: false,
});
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
}
const result = compiler.compileDefinitionString(ts, {
quiet: true,
inexact: false,
});
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
});

it("should not use spread when performing union of inexact object types", () => {
Expand All@@ -30,21 +21,12 @@ type Foo = { foo: number };
type Bar = { bar: string };
const combination: Foo & Bar;
`;

{
const result = compiler.compileDefinitionString(ts, { quiet: true });
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
}

{
const result = compiler.compileDefinitionString(ts, {
quiet: true,
inexact: true,
});
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
}
const result = compiler.compileDefinitionString(ts, {
quiet: true,
inexact: true,
});
expect(beautify(result)).toMatchSnapshot();
expect(result).toBeValidFlowTypeDeclarations();
});

it("should not insert spread when performing union of class types", () => {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp