Skip to content

Commit

Permalink
Fix: tests for ESLint v1
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed May 5, 2016
1 parent 15c9335 commit 307e839
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/rules/process-exit-as-throw.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

**Experimental:** This rule is an experimental thing. This may be changed without major bump in future.

**Note:** This rule is not working on ESLint v1 because v1 doesn't support code path analysis.

## Rule Details

```js
Expand Down
1 change: 1 addition & 0 deletions lib/rules/process-exit-as-throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ var visitor = CodePathAnalyzer == null ? {} : {

module.exports = {
meta: {
supported: CodePathAnalyzer != null,
schema: []
},
create: function() {
Expand Down
8 changes: 5 additions & 3 deletions tests/lib/rules/process-exit-as-throw.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ var rule = require("../../../lib/rules/process-exit-as-throw");
// Tests
//------------------------------------------------------------------------------

var supported = rule.meta.supported;

describe("process-exit-as-throw", function() {
beforeEach(function() {
eslint.reset();
eslint.defineRule("process-exit-as-throw", rule);
});

it("should get unreachable error after 'process.exit()'.", function() {
(supported ? it : xit)("should get unreachable error after 'process.exit()'.", function() {
var code = [
"foo();",
"process.exit(1);",
Expand All @@ -46,7 +48,7 @@ describe("process-exit-as-throw", function() {
assert.equal(messages[0].line, 3);
});

it("should get no unreachable error after 'process.exit()' if this rule is turned off.", function() {
(supported ? it : xit)("should get no unreachable error after 'process.exit()' if this rule is turned off.", function() {
var code = [
"foo();",
"process.exit(1);",
Expand All @@ -65,7 +67,7 @@ describe("process-exit-as-throw", function() {
assert.equal(messages.length, 0);
});

it("should get no consistent-return error after 'process.exit()'.", function() {
(supported ? it : xit)("should get no consistent-return error after 'process.exit()'.", function() {
var code = [
"function foo() {",
" if (a) {",
Expand Down

0 comments on commit 307e839

Please sign in to comment.