Fix tests

This commit is contained in:
Nathan Bierema 2021-06-17 21:04:58 -04:00
parent 317dbc825c
commit 52c9f50f63
3 changed files with 12 additions and 12 deletions

View File

@ -17,7 +17,7 @@ describe('Server', function () {
describe('Express backend', function () {
it('loads main page', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.get('/')
@ -64,7 +64,7 @@ describe('Server', function () {
});
it('should connect', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
socket.on('connect', function (status) {
expect(status.id).toBeTruthy();
done();
@ -89,7 +89,7 @@ describe('Server', function () {
});
it('should send message', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
const data = {
type: 'ACTION',
payload: {
@ -146,7 +146,7 @@ describe('Server', function () {
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36',
};
it('should add a report', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
@ -163,7 +163,7 @@ describe('Server', function () {
});
it('should get the report', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
@ -182,7 +182,7 @@ describe('Server', function () {
});
it('should list reports', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/')
@ -207,7 +207,7 @@ describe('Server', function () {
describe('GraphQL backend', function () {
it('should get the report', function () {
return new Promise((done) => {
return new Promise<void>((done) => {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
request('http://localhost:8000')
.post('/graphql')

View File

@ -33,14 +33,14 @@ const StackTraceTabAsAny = StackTraceTab as any;
describe('StackTraceTab component', () => {
it('should render with no props', () => {
return new Promise((done) => {
return new Promise<void>((done) => {
const component = mount(<StackTraceTabAsAny />);
genAsyncSnapshot(component, done);
});
});
it('should render with props, but without stack', () => {
return new Promise((done) => {
return new Promise<void>((done) => {
const component = mount(
<StackTraceTabAsAny actions={actions} action={actions[0].action} />
);
@ -49,7 +49,7 @@ describe('StackTraceTab component', () => {
});
it('should render the link to docs', () => {
return new Promise((done) => {
return new Promise<void>((done) => {
const component = mount(
<StackTraceTabAsAny actions={actions} action={actions[1].action} />
);
@ -58,7 +58,7 @@ describe('StackTraceTab component', () => {
});
it('should render with trace stack', () => {
return new Promise((done) => {
return new Promise<void>((done) => {
const component = mount(
<StackTraceTabAsAny actions={actions} action={actions[2].action} />
);

View File

@ -1071,7 +1071,7 @@ describe('instrument', () => {
});
it('should get stack trace inside setTimeout using a function', () =>
new Promise((done) => {
new Promise<void>((done) => {
const stack = new Error().stack;
setTimeout(() => {
const traceFn = () => stack! + new Error().stack!;