Skip to content

Commit cfa6cf9

Browse files
kauanAfonsoKauanAfonso
authored andcommitted
test: skip address-based reminder test on Windows
Signed-off-by: kauanAfonso <kauan.afonso@ibm.com>
1 parent 489e304 commit cfa6cf9

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

examples/todo/src/__tests__/acceptance/todo.acceptance.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
createRestAppClient,
1111
expect,
1212
givenHttpServerConfig,
13+
skipIf,
1314
toJSON,
1415
} from '@loopback/testlab';
1516
import morgan from 'morgan';
@@ -86,20 +87,25 @@ describe('TodoApplication', () => {
8687
await client.post('/todos').send(todo).expect(422);
8788
});
8889

89-
it('creates an address-based reminder', async function (this: Mocha.Context) {
90-
if (!available) return this.skip();
91-
// Increase the timeout to accommodate slow network connections
92-
this.timeout(30000);
93-
94-
const todo = givenTodo({remindAtAddress: aLocation.address});
95-
const response = await client.post('/todos').send(todo).expect(200);
96-
todo.remindAtGeo = aLocation.geostring;
97-
98-
expect(response.body).to.containEql(todo);
99-
100-
const result = await todoRepo.findById(response.body.id);
101-
expect(result).to.containEql(todo);
102-
});
90+
skipIf<[(this: Mocha.Context) => void], void>(
91+
process.platform === 'win32',
92+
it,
93+
'creates an address-based reminder',
94+
async function (this: Mocha.Context) {
95+
if (!available) return this.skip();
96+
// Increase the timeout to accommodate slow network connections
97+
this.timeout(30000);
98+
99+
const todo = givenTodo({remindAtAddress: aLocation.address});
100+
const response = await client.post('/todos').send(todo).expect(200);
101+
todo.remindAtGeo = aLocation.geostring;
102+
103+
expect(response.body).to.containEql(todo);
104+
105+
const result = await todoRepo.findById(response.body.id);
106+
expect(result).to.containEql(todo);
107+
},
108+
);
103109

104110
it('returns 400 if it cannot find an address', async function (this: Mocha.Context) {
105111
if (!available) return this.skip();

0 commit comments

Comments
 (0)