mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
35 lines
939 B
JavaScript
35 lines
939 B
JavaScript
|
const testBoilerplate = (name, author, description) => `/* eslint-env jest */
|
||
|
/**
|
||
|
* @fileoverview ${description}
|
||
|
* @author ${author}
|
||
|
*/
|
||
|
|
||
|
// -----------------------------------------------------------------------------
|
||
|
// Requirements
|
||
|
// -----------------------------------------------------------------------------
|
||
|
|
||
|
import { RuleTester } from 'eslint';
|
||
|
import parserOptionsMapper from '../../__util__/parserOptionsMapper';
|
||
|
import rule from '../../../src/rules/${name}';
|
||
|
|
||
|
// -----------------------------------------------------------------------------
|
||
|
// Tests
|
||
|
// -----------------------------------------------------------------------------
|
||
|
|
||
|
const ruleTester = new RuleTester();
|
||
|
|
||
|
const expectedError = {
|
||
|
message: '',
|
||
|
type: 'JSXOpeningElement',
|
||
|
};
|
||
|
|
||
|
ruleTester.run('${name}', rule, {
|
||
|
valid: [
|
||
|
{ code: '<div />;' },
|
||
|
].map(parserOptionsMapper),
|
||
|
invalid: [].map(parserOptionsMapper),
|
||
|
});
|
||
|
`;
|
||
|
|
||
|
module.exports = testBoilerplate;
|