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

View File

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