detect-no-csrf-before-method-override.js 461 B

1234567891011121314151617
  1. 'use strict';
  2. const RuleTester = require('eslint').RuleTester;
  3. const tester = new RuleTester();
  4. const ruleName = 'detect-no-csrf-before-method-override';
  5. tester.run(ruleName, require(`../rules/${ruleName}`), {
  6. valid: [{ code: 'express.methodOverride();express.csrf()' }],
  7. invalid: [
  8. {
  9. code: 'express.csrf();express.methodOverride()',
  10. errors: [{ message: 'express.csrf() middleware found before express.methodOverride()' }]
  11. }
  12. ]
  13. });