Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2021-08-11 13:02:43 +00:00
parent 46043e8a9e
commit 4a0d3378b1
21 changed files with 760 additions and 6 deletions

View file

@ -0,0 +1,25 @@
name: Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v1
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Tests
run: yarn run test
env:
CI: true

View file

@ -0,0 +1,54 @@
name: Release
on:
release:
types: [created]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- run: npm test
publish-npm:
name: Publish NPM
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-gpr:
name: Publish GPR
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
scope: '@levibuzolic'
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

57
node_modules/eslint-plugin-no-only-tests/CHANGELOG.md generated vendored Normal file
View file

@ -0,0 +1,57 @@
# v2.6.0
* Disable auto fixing by default, allow it to be optionally enabled.
# v2.5.0
* Add support for auto fixing violations - #19 @tgreen7
# v2.4.0
* Add support for defining 2 levels deep in blocks (ie. `ava.default`)
# v2.3.1
* Bump js-yaml from 3.13.0 to 3.13.1 due to security vulnerability - #11
# v2.3.0
* Allow test block names to be specified in options - #10
# v2.2.0
* Added rule for catching `.only` blocks for `serial` - #9 @IevgenRagulin
# v2.1.0
* Added rule for catching `.only` blocks for `fixture` - #8 @roughy
# v2.0.1
* Fixed major bug where rule would cause errors for objects with key `only` - #7 @bendemboski
# v2.0.0
* Updated rule format to ESLint 3
* Updated ESLInt dependency to `>=3.0.0`
* Updated node engine to `>=4.0.0`
* Get CircleCI up and running
# v1.2.0
* Added rules for catching `.only` blocks for `test`, `context` and `tape`
# v1.1.0
* Updated rule to use `Identifier` rather than `CallExpression`
* Changed reporter to give a more generic message (removed reference to mocha)
* Added additional test coverage
# v1.0.1
* Added additional test coverage
* Removed unnecessary dependencies in `package.json`
# v1.0.0
* Initial version

21
node_modules/eslint-plugin-no-only-tests/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Levi Buzolic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

75
node_modules/eslint-plugin-no-only-tests/README.md generated vendored Normal file
View file

@ -0,0 +1,75 @@
# eslint-plugin-no-only-tests
[![Version](https://img.shields.io/npm/v/eslint-plugin-no-only-tests.svg)](https://www.npmjs.com/package/eslint-plugin-no-only-tests) [![Downloads](https://img.shields.io/npm/dm/eslint-plugin-no-only-tests.svg)](https://npmcharts.com/compare/eslint-plugin-no-only-tests?minimal=true) [![GitHub Tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests/workflows/Tests/badge.svg)](https://github.com/levibuzolic/eslint-plugin-no-only-tests/actions?query=workflow%3ATests)
ESLint rule for `.only` tests in [mocha](https://mochajs.org/) and other JS testing libraries.
Currently matches the following test blocks by default: `describe`, `it`, `context`, `tape`, `test`, `fixture`, `serial`.
Designed to prevent you from committing `.only` tests to CI, disabling tests for your whole team.
As of v2.3 you can now override the test blocks and focus functions.
## Installation
First you'll need to install [ESLint](http://eslint.org) then the plugin:
```bash
npm install --save-dev eslint eslint-plugin-no-only-tests
# or
yarn add --dev eslint eslint-plugin-no-only-tests
```
> **Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-no-only-tests` globally.
## Usage
Add `no-only-tests` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
```json
{
"plugins": [
"no-only-tests"
]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"no-only-tests/no-only-tests": "error"
}
}
```
If you use a testing framework that uses an unsupported block name, or a different way of focusing test (something other than `.only`) you can specify an array of blocks and focus methods to match in the options.
```json
{
"rules": {
"no-only-tests/no-only-tests": ["error", {"block": ["test", "it", "assert"], "focus": ["only", "focus"]}]
}
}
```
The above example will catch any uses of `test.only`, `test.focus`, `it.only`, `it.focus`, `assert.only` and `assert.focus`.
This rule supports autofixing only when the `fix` option is set to `true` to avoid changing runtime code unintentionally when configured in an editor.
```json
{
"rules": {
"no-only-tests/no-only-tests": ["error", {"fix": true}]
}
}
```
## Options
Option | Type | Description
---|---|---
`block` | `Array<string>` | Specify the block names that your testing framework uses. Defaults to `["describe", "it", "context", "test", "tape", "fixture", "serial"]`
`focus` | `Array<string>` | Specify the focus scope that your testing framework uses. Defaults to `["only"]`
`fix` | `boolean` | Enable this rule to auto-fix violations, useful for a pre-commit hook, not recommended for users with auto-fixing enabled in their editor. Defaults to `false`

7
node_modules/eslint-plugin-no-only-tests/index.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
'use strict';
module.exports = {
rules: {
'no-only-tests': require('./rules/no-only-tests')
}
};

36
node_modules/eslint-plugin-no-only-tests/package.json generated vendored Normal file
View file

@ -0,0 +1,36 @@
{
"name": "eslint-plugin-no-only-tests",
"version": "2.6.0",
"description": "ESLint rule for .only blocks in mocha tests",
"keywords": [
"eslint",
"eslintplugin",
"eslint-plugin",
"mocha",
"rule",
"only",
"describe",
"it",
"fixture"
],
"author": "Levi Buzolic",
"main": "index.js",
"scripts": {
"test": "node tests.js"
},
"devDependencies": {
"eslint": ">=3.0.0"
},
"engines": {
"node": ">=4.0.0"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git@github.com:levibuzolic/eslint-plugin-no-only-tests.git"
},
"bugs": {
"url": "https://github.com/levibuzolic/no-only-tests/issues"
},
"homepage": "https://github.com/levibuzolic/no-only-tests#readme"
}

View file

@ -0,0 +1,88 @@
/**
* @fileoverview Rule to flag use of .only in tests, preventing focused tests being committed accidentally
* @author Levi Buzolic
*/
'use strict';
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const BLOCK_DEFAULTS = ['describe', 'it', 'context', 'test', 'tape', 'fixture', 'serial'];
const FOCUS_DEFAULTS = ['only'];
module.exports = {
meta: {
docs: {
description: 'disallow .only blocks in tests',
category: 'Possible Errors',
recommended: true,
url: 'https://github.com/levibuzolic/eslint-plugin-no-only-tests',
},
fixable: true,
schema: [
{
type: 'object',
properties: {
block: {
type: 'array',
items: {
type: 'string',
},
uniqueItems: true,
},
focus: {
type: 'array',
items: {
type: 'string',
},
uniqueItems: true,
},
fix: {
type: 'boolean',
},
},
additionalProperties: false,
},
],
},
create(context) {
var block = (context.options[0] || {}).block || BLOCK_DEFAULTS;
var focus = (context.options[0] || {}).focus || FOCUS_DEFAULTS;
var fix = !!(context.options[0] || {}).fix;
return {
Identifier(node) {
var parentObject = node.parent && node.parent.object;
if (parentObject == null) return;
if (focus.indexOf(node.name) === -1) return;
var callPath = getCallPath(node.parent).join('.');
// comparison guarantees that matching is done with the beginning of call path
if (block.find(b => callPath.split(b)[0] === '')) {
context.report({
node,
message: callPath + ' not permitted',
fix: fix ? fixer => fixer.removeRange([node.range[0] - 1, node.range[1]]) : undefined,
});
}
},
};
},
};
function getCallPath(node, path = []) {
if (node) {
const nodeName = node.name || (node.property && node.property.name);
if (node.object) {
return getCallPath(node.object, [nodeName, ...path]);
}
if (node.callee) {
return getCallPath(node.callee, path);
}
return [nodeName, ...path];
}
return path;
}