mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
We don't want these accidentally committed. Bug: 1101782 Change-Id: I67a820bbaa6b8a8d1cb4a1a6afdb29bc8dacdc5e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354107 Commit-Queue: Peter Marshall <petermarshall@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
'use strict';
|
|
|
|
const rule = require('../lib/no_repeated_tests.js');
|
|
const ruleTester = new (require('eslint').RuleTester)({
|
|
parserOptions: {ecmaVersion: 9, sourceType: 'module'},
|
|
});
|
|
|
|
ruleTester.run('no_repeated_tests', rule, {
|
|
valid: [
|
|
{
|
|
code: `import {describe, it} from '../../shared/mocha-extensions.js';
|
|
|
|
describe('e2e-test', async () => {
|
|
it('normal test', async () => {
|
|
});
|
|
});
|
|
`,
|
|
filename: 'test/e2e/folder/file.ts',
|
|
},
|
|
],
|
|
|
|
invalid: [
|
|
{
|
|
code: `import {describe, it} from '../../shared/mocha-extensions.js';
|
|
|
|
describe('e2e-test', async () => {
|
|
it.repeat(5, 'with repeat#', async () => {
|
|
});
|
|
});
|
|
`,
|
|
filename: 'test/e2e/folder/file.ts',
|
|
errors: [{message: 'Unexpected repeated mocha test'}],
|
|
},
|
|
{
|
|
code: `import {describe, it} from '../../shared/mocha-extensions.js';
|
|
|
|
describe('e2e-test', async () => {
|
|
it.repeat('forgot the repeat#', async () => {
|
|
});
|
|
});
|
|
`,
|
|
filename: 'test/e2e/folder/file.ts',
|
|
errors: [{message: 'Unexpected repeated mocha test'}],
|
|
},
|
|
]
|
|
});
|