Skip to content

Commit

Permalink
use node based test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
Marieke-C committed Feb 14, 2024
1 parent 2956bac commit d983381
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const {
utils: { report, ruleMessages, validateOptions }
} = stylelint;

export const ruleName = 'plugin/selector-tag-no-without-class';
export const messages = ruleMessages(ruleName, {
const ruleName = 'plugin/selector-tag-no-without-class';
const messages = ruleMessages(ruleName, {
unexpected: (tagName) => `Unexpected tag ${tagName} without class qualifier`
});

Expand Down
15 changes: 11 additions & 4 deletions index.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { ruleName, messages } from "./index";

import plugin from "./index.js";
import { testRule } from "stylelint-test-rule-node";

const plugins = [plugin];
const {
ruleName,
rule: { messages }
} = plugin;

testRule({
ruleName: ruleName,
plugins,
ruleName,
config: [ 'span', 'div' ],

accept: [
Expand Down Expand Up @@ -54,7 +60,8 @@ testRule({
});

testRule({
ruleName: ruleName,
plugins,
ruleName,
config: [ '/./' ],

accept: [
Expand Down
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

3 changes: 0 additions & 3 deletions jest.setup.js

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "index.js",
"exports": "./index.js",
"scripts": {
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-warnings\" jest --runInBand"
"test": "node --test index.test.js"
},
"author": {
"name": "Moxio",
Expand All @@ -30,8 +30,8 @@
"devDependencies": {
"cross-env": "^7.0.3",
"jest": "^29.5.0",
"jest-preset-stylelint": "^6.1.0",
"stylelint": "^16.0.0"
"stylelint": "^16.2.1",
"stylelint-test-rule-node": "^0.2.1"
},
"peerDependencies": {
"stylelint": ">= 9.x < 17"
Expand Down

0 comments on commit d983381

Please sign in to comment.