[tests] remove unnecessary promise resulotions and add fetch to the .eslintrc

This commit is contained in:
Omer Levy 2017-10-08 16:25:02 +03:00
parent bcb704dd1c
commit 49a54ebedc
2 changed files with 3 additions and 7 deletions

View File

@ -36,6 +36,7 @@
}, },
"globals": { "globals": {
"__DEV__": true, "__DEV__": true,
"window": true "window": true,
"fetch": true,
} }
} }

View File

@ -74,7 +74,6 @@ function linksTests({ describe, it, firebase, tryCatch }) {
result.includes(`${key}=${encodedVal}`) || result.includes(`${key}=${encodedVal}`) ||
result.includes(`${key}=${encodedValWithPeriod}`)).should.be.true(); result.includes(`${key}=${encodedValWithPeriod}`)).should.be.true();
}); });
Promise.resolve();
}); });
it('create long dynamic link with minimal parameters', async () => { it('create long dynamic link with minimal parameters', async () => {
@ -93,7 +92,6 @@ function linksTests({ describe, it, firebase, tryCatch }) {
const encodedLinkWithEncodedPeriod = encodeURIComponent(link).replace(/\./g, '%2E'); const encodedLinkWithEncodedPeriod = encodeURIComponent(link).replace(/\./g, '%2E');
(result.includes(`link=${encodedLink}`) || (result.includes(`link=${encodedLink}`) ||
result.includes(`link=${encodedLinkWithEncodedPeriod}`)).should.be.true(); result.includes(`link=${encodedLinkWithEncodedPeriod}`)).should.be.true();
Promise.resolve();
}); });
it('fail to create long dynamic link with empty data object', () => { it('fail to create long dynamic link with empty data object', () => {
@ -382,7 +380,6 @@ function linksTests({ describe, it, firebase, tryCatch }) {
const response = await fetch(result); const response = await fetch(result);
url.should.eql(response.url); url.should.eql(response.url);
Promise.resolve();
}); });
it('create short (short) dynamic link with all supported parameters', async () => { it('create short (short) dynamic link with all supported parameters', async () => {
@ -420,21 +417,19 @@ function linksTests({ describe, it, firebase, tryCatch }) {
const response = await fetch(result); const response = await fetch(result);
url.should.eql(response.url); url.should.eql(response.url);
Promise.resolve();
}); });
it('getInitialLink should return null', async () => { it('getInitialLink should return null', async () => {
const initialLink = await links.getInitialLink(); const initialLink = await links.getInitialLink();
should(initialLink).be.null(); should(initialLink).be.null();
Promise.resolve();
}); });
it('should listen to link', () => { it('should listen to link', () => {
const unsubscribe = links.onLink((url: string) => { const unsubscribe = links.onLink((url: string) => {
console.log(url);
// handle link // handle link
}); });
unsubscribe(); unsubscribe();
Promise.resolve();
}); });
}); });
} }