Skip to content

Commit

Permalink
Merge branch 'main' into refactor/rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl authored Feb 20, 2024
2 parents 6ec0acc + eb31818 commit d5136e8
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions specs/creators/rule.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ import { describe, it } from 'mocha';
import createRule from '../../src/creators/rule.js';

describe('Create Rule', () => {
it('create an object with args (selector: String, [::pseudo-element])', () => {
const rule = createRule('::pseudo-element');
let rule;

expect(rule).to.have.property('selector', '&::pseudo-element');
beforeEach(() => {
rule = createRule;
});

it('create an object with args (selector: String, [:pseudo-class])', () => {
const rule = createRule(':pseudo-class');
it('create an object with args (selector: String, [::pseudo-element])', () => {
expect(rule('::pseudo-element')).to.have.property(
'selector',
'&::pseudo-element',
);
});

expect(rule).to.have.property('selector', '&:pseudo-class');
it('create an object with args (selector: String, [:pseudo-class])', () => {
expect(rule(':pseudo-class')).to.have.property('selector', '&:pseudo-class');
});

it('create an object with args (selector: RegExp, [\\[[^\\[\\]]+\\]])', () => {
const rule = createRule('\\[[^\\[\\]]+\\]');

expect(rule).to.have.property('selector', '&\\[[^\\[\\]]+\\]');
expect(rule('\\[[^\\[\\]]+\\]')).to.have.property(
'selector',
'&\\[[^\\[\\]]+\\]',
);
});

it('create an object with args (selector: RegExp, [\\..+])', () => {
const rule = createRule('\\..+');

expect(rule).to.have.property('selector', '&\\..+');
expect(rule('\\..+')).to.have.property('selector', '&\\..+');
});

it('create an object with args (selector: RegExp, [--.+])', () => {
const rule = createRule('--.+');

expect(rule).to.have.property('selector', '&--.+');
expect(rule('--.+')).to.have.property('selector', '&--.+');
});

it('create an object with args (selector: RegExp, [?.* &])', () => {
const rule = createRule('?.* &');

expect(rule).to.have.property('selector', '&?.* &');
expect(rule('?.* &')).to.have.property('selector', '&?.* &');
});
});

0 comments on commit d5136e8

Please sign in to comment.