Skip to content

Commit

Permalink
Update deps (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 committed May 14, 2021
1 parent 6a0b589 commit f2f43c2
Show file tree
Hide file tree
Showing 6 changed files with 17,954 additions and 5,395 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Expand Up @@ -20,7 +20,7 @@ jobs:

strategy:
matrix:
node: [12]
node: [14]
os: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12]
node: [12, 14, 16]

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
@@ -0,0 +1 @@
_
6 changes: 6 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,6 @@
#!/bin/sh
[ -n "$CI" ] && exit 0

. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
16 changes: 8 additions & 8 deletions getTestRule.js
Expand Up @@ -24,21 +24,21 @@ function getTestRule(options = {}) {
cases: passingTestCases,
schema,
comparisons: (testCase) => async () => {
const options = {
const stylelintOptions = {
code: testCase.code,
config: stylelintConfig,
syntax: schema.syntax,
};

const output = await lint(options);
const output = await lint(stylelintOptions);

expect(output.results[0].warnings).toEqual([]);
expect(output.results[0].parseErrors).toEqual([]);

if (!schema.fix) return;

// Check that --fix doesn't change code
const outputAfterFix = await lint({ ...options, fix: true });
const outputAfterFix = await lint({ ...stylelintOptions, fix: true });
const fixedCode = getOutputCss(outputAfterFix);

expect(fixedCode).toBe(testCase.code);
Expand All @@ -50,13 +50,13 @@ function getTestRule(options = {}) {
cases: schema.reject,
schema,
comparisons: (testCase) => async () => {
const options = {
const stylelintOptions = {
code: testCase.code,
config: stylelintConfig,
syntax: schema.syntax,
};

const outputAfterLint = await lint(options);
const outputAfterLint = await lint(stylelintOptions);

const actualWarnings = outputAfterLint.results[0].warnings;

Expand Down Expand Up @@ -88,7 +88,7 @@ function getTestRule(options = {}) {
);
}

const outputAfterFix = await lint({ ...options, fix: true });
const outputAfterFix = await lint({ ...stylelintOptions, fix: true });

const fixedCode = getOutputCss(outputAfterFix);

Expand All @@ -106,7 +106,7 @@ function getTestRule(options = {}) {

// Checks whether only errors other than those fixed are reported
const outputAfterLintOnFixedCode = await lint({
...options,
...stylelintOptions,
code: fixedCode,
});

Expand Down Expand Up @@ -137,7 +137,7 @@ function getTestRule(options = {}) {

function setupTestCases({ name, cases, schema, comparisons }) {
if (cases && cases.length) {
describe(name, () => {
describe(`${name}`, () => {
cases.forEach((testCase) => {
if (testCase) {
const spec = testCase.only ? it.only : testCase.skip ? it.skip : it;
Expand Down

0 comments on commit f2f43c2

Please sign in to comment.