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>
31 lines
804 B
JavaScript
31 lines
804 B
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.
|
|
|
|
/**
|
|
* @fileoverview Rule to check that .repeat() is not used in mocha tests
|
|
* @author Peter Marshall
|
|
*/
|
|
'use strict';
|
|
|
|
module.exports = {
|
|
meta: {
|
|
type: 'problem',
|
|
docs: {
|
|
description: 'usage of .repeat() in mocha tests',
|
|
category: 'Possible Errors',
|
|
},
|
|
fixable: 'code',
|
|
schema: [] // no options
|
|
},
|
|
create: function(context) {
|
|
return {
|
|
MemberExpression(node) {
|
|
if (node.object.name === 'it' && node.property.name === 'repeat' && node.parent.type === 'CallExpression') {
|
|
context.report({node, message: 'Unexpected repeated mocha test'});
|
|
}
|
|
}
|
|
};
|
|
}
|
|
};
|