mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
24 lines
585 B
JavaScript
24 lines
585 B
JavaScript
|
'use strict';
|
||
|
|
||
|
require('../common');
|
||
|
|
||
|
const RuleTester = require('../../tools/eslint').RuleTester;
|
||
|
const rule = require('../../tools/eslint-rules/inspector-check');
|
||
|
|
||
|
const message = 'Please add a skipIfInspectorDisabled() call to allow this ' +
|
||
|
'test to be skippped when Node is built ' +
|
||
|
'\'--without-inspector\'.';
|
||
|
|
||
|
new RuleTester().run('inspector-check', rule, {
|
||
|
valid: [
|
||
|
'foo;',
|
||
|
'common.skipIfInspectorDisabled(); require("inspector");'
|
||
|
],
|
||
|
invalid: [
|
||
|
{
|
||
|
code: 'require("inspector")',
|
||
|
errors: [{ message }]
|
||
|
}
|
||
|
]
|
||
|
});
|