Skip to content

Commit

Permalink
Rebase on master
Browse files Browse the repository at this point in the history
  • Loading branch information
NameFILIP committed Oct 26, 2018
1 parent 6a18a4b commit c6ef5bb
Showing 1 changed file with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import isoUnfetch from "isomorphic-unfetch";
import isoUnfetch from 'isomorphic-unfetch';

(isoUnfetch("foo"): Promise<Response>);
(isoUnfetch("foo", {}): Promise<Response>);
(isoUnfetch('foo'): Promise<Response>);
(isoUnfetch('foo', {}): Promise<Response>);

// $ExpectError url has to be string
(isoUnfetch(123): Promise<any>);

isoUnfetch("foo", {
method: "GET"
isoUnfetch('foo', {
method: 'GET'
});

isoUnfetch("foo", {
body: "bar"
isoUnfetch('foo', {
body: 'bar'
});

// $ExpectError number is not a valid body type
isoUnfetch("foo", {
body: 5
isoUnfetch('foo', {
body: 5
});

// Response tests
isoUnfetch("foo").then(res => {
(res.clone(): Response);

// Response Headers
(res.headers: Headers);
(res.headers.append("foo", "bar"): void);
// $ExpectError
(res.headers.append(5, "bar"): void);
(res.headers.delete("foo"): void);
// $ExpectError
(res.headers.delete(5): void);
(res.headers.entries(): Iterator<*>);
(res.headers.get("test"): string);
// $ExpectError
(res.headers.get(5): string);
(res.headers.has("foo"): boolean);
// $ExpectError
(res.headers.has(5): boolean);
(res.headers.keys(): Iterator<string>);
// $ExpectError value should be a string
(res.headers.set("foo", 5): void);
(res.headers.values(): Iterator<*>);

(res.ok: boolean);
(res.status: number);
(res.statusText: string);

// Response type
(res.type: ResponseType);
res.type = "basic";
// $ExpectError foo is not a valid option
res.type = "foo";

(res.url: string);
isoUnfetch('foo').then(res => {
(res.clone(): Response);

// Response Headers
(res.headers: Headers);
(res.headers.append('foo', 'bar'): void);
// $ExpectError
(res.headers.append(5, 'bar'): void);
(res.headers.delete('foo'): void);
// $ExpectError
(res.headers.delete(5): void);
(res.headers.entries(): Iterator<*>);
(res.headers.get('test'): string);
// $ExpectError
(res.headers.get(5): string);
(res.headers.has('foo'): boolean);
// $ExpectError
(res.headers.has(5): boolean);
(res.headers.keys(): Iterator<string>);
// $ExpectError value should be a string
(res.headers.set('foo', 5): void);
(res.headers.values(): Iterator<*>);

(res.ok: boolean);
(res.status: number);
(res.statusText: string);

// Response type
(res.type: ResponseType);
res.type = 'basic';
// $ExpectError foo is not a valid option
res.type = 'foo';

(res.url: string);
});

0 comments on commit c6ef5bb

Please sign in to comment.