Skip to content

Commit

Permalink
test(index): refactor tests and use expect and it.each
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jun 16, 2019
1 parent 100311d commit dbf2ef0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const assert = require('assert');
const css = require('css');
const parse = require('..');
const inlineStyleParser = require('..');
const { cases } = require('./data');

/**
Expand All @@ -26,11 +25,8 @@ function removePosition(declarations) {
}));
}

cases.forEach(inlineStyle => {
it(`parses \`${inlineStyle}\``, () => {
assert.deepEqual(
removePosition(parse(inlineStyle)),
removePosition(getDeclarations(inlineStyle))
);
});
it.each(cases)('parses `%s`', style => {
expect(removePosition(inlineStyleParser(style))).toEqual(
removePosition(getDeclarations(style))
);
});

0 comments on commit dbf2ef0

Please sign in to comment.