initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
52
github/codeql-action-v2/node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js
generated
vendored
Normal file
52
github/codeql-action-v2/node_modules/eslint-plugin-no-async-foreach/tests/lib/rules/no-async-foreach.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* @fileoverview Blah
|
||||
* @author El
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
var rule = require("../../../lib/no-async-foreach"),
|
||||
|
||||
RuleTester = require("eslint").RuleTester;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Tests
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const ERROR_MSG = 'No async function in forEachs';
|
||||
|
||||
var ruleTester = new RuleTester();
|
||||
ruleTester.run("no-async-foreach", rule, {
|
||||
|
||||
valid: [
|
||||
{
|
||||
code: "[].forEach(() => {})",
|
||||
parserOptions: { ecmaVersion: 8 }
|
||||
},
|
||||
{
|
||||
code: "[].forEach(function() {})",
|
||||
parserOptions: { ecmaVersion: 8 }
|
||||
}
|
||||
],
|
||||
|
||||
invalid: [
|
||||
{
|
||||
code: "[].forEach(async () => {});",
|
||||
parserOptions: { ecmaVersion: 8 },
|
||||
errors: [{
|
||||
message: ERROR_MSG,
|
||||
}]
|
||||
},
|
||||
{
|
||||
code: "[].forEach(async function() {});",
|
||||
parserOptions: { ecmaVersion: 8 },
|
||||
errors: [{
|
||||
message: ERROR_MSG,
|
||||
}]
|
||||
}
|
||||
]
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue