Skip to content

Commit c976ba4

Browse files
chore: test Restify 18 in the install tests (#324)
1 parent 85f7d76 commit c976ba4

File tree

1 file changed

+48
-6
lines changed

1 file changed

+48
-6
lines changed

system-test/test-install.ts

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const SKIP = {
2323
express: false,
2424
hapi: {sixteen: false, seventeen: false},
2525
koa: {one: false, two: false},
26-
restify: false
26+
restify: {seven: false, eight: false}
2727
};
2828

2929
const TS_CODE_ARRAY: check.CodeSample[] = [
@@ -217,9 +217,30 @@ server.get('/hello/:name', respond);
217217
server.head('/hello/:name', respond);
218218
`,
219219
description: 'uses restify',
220-
dependencies: ['restify'],
221-
devDependencies: ['@types/restify'],
222-
skip: SKIP.restify
220+
dependencies: ['restify@7.x.x'],
221+
devDependencies: ['@types/restify@7.x.x'],
222+
skip: SKIP.restify.seven
223+
},
224+
{
225+
code: `import * as restify from 'restify';
226+
227+
import {ErrorReporting} from '@google-cloud/error-reporting';
228+
const errors = new ErrorReporting();
229+
230+
function respond(req: {}, res: {}, next: Function) {
231+
next(new Error('this is a restify error'));
232+
}
233+
234+
const server = restify.createServer();
235+
236+
server.use(errors.restify(server));
237+
server.get('/hello/:name', respond);
238+
server.head('/hello/:name', respond);
239+
`,
240+
description: 'uses restify',
241+
dependencies: ['restify@8.x.x'],
242+
devDependencies: ['@types/restify@7.x.x'],
243+
skip: SKIP.restify.eight
223244
},
224245
];
225246

@@ -411,10 +432,31 @@ server.get('/hello/:name', respond);
411432
server.head('/hello/:name', respond);
412433
`,
413434
description: 'uses restify',
414-
dependencies: ['restify'],
435+
dependencies: ['restify@7.x.x'],
415436
devDependencies: [],
416-
skip: SKIP.restify
437+
skip: SKIP.restify.seven
417438
},
439+
{
440+
code: `const restify = require('restify');
441+
442+
const ErrorReporting = require('@google-cloud/error-reporting').ErrorReporting;
443+
const errors = new ErrorReporting();
444+
445+
function respond(req, res, next) {
446+
next(new Error('this is a restify error'));
447+
}
448+
449+
const server = restify.createServer();
450+
451+
server.use(errors.restify(server));
452+
server.get('/hello/:name', respond);
453+
server.head('/hello/:name', respond);
454+
`,
455+
description: 'uses restify',
456+
dependencies: ['restify@8.x.x'],
457+
devDependencies: [],
458+
skip: SKIP.restify.eight
459+
}
418460
];
419461

420462
check.testInstallation(TS_CODE_ARRAY, JS_CODE_ARRAY, {timeout: 2 * 60 * 1000});

0 commit comments

Comments
 (0)