Skip to content

Commit

Permalink
Add test for issue #1252
Browse files Browse the repository at this point in the history
  • Loading branch information
tihonove committed Feb 17, 2019
1 parent bdc05aa commit 7563655
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,33 @@ ruleTester.run('order', rule, {
message: '`fs` import should occur before import of `async`',
}],
})),
// reorder fix cannot cross function call on moving below (from #1252)
test({
code: `
const env = require('./config');
Object.keys(env);
const http = require('http');
const express = require('express');
http.createServer(express());
`,
output: `
const env = require('./config');
Object.keys(env);
const http = require('http');
const express = require('express');
http.createServer(express());
`,
errors: [{
ruleId: 'order',
message: '`./config` import should occur after import of `express`',
}],
}),
// reorder cannot cross non plain requires
test(withoutAutofixOutput({
code: `
Expand Down

0 comments on commit 7563655

Please sign in to comment.