Skip to content

Commit

Permalink
* Remove chai dependency from test-kit
Browse files Browse the repository at this point in the history
  • Loading branch information
barak007 committed Jun 12, 2018
1 parent e2680fc commit 80afe54
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/stylable/tests/utils/ast-matchers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from 'chai';
import * as postcss from 'postcss';

export function matchRuleAndDeclaration(
Expand All @@ -9,11 +8,13 @@ export function matchRuleAndDeclaration(
msg?: string
) {
const rule = parent.nodes![selectorIndex] as postcss.Rule;
expect(rule.selector, `${msg ? msg + ' ' : ''}selector ${selectorIndex}`).to.equal(selector);
expect(
rule.nodes!.map(x => x.toString()).join(';'),
`${msg ? msg + ' ' : ''}selector ${selectorIndex} first declaration`
).to.equal(decl);
if (rule.selector !== selector) {
throw new Error(`${msg ? msg + ' ' : ''}selector ${selectorIndex}`);
}
// expect(rule.selector, `${msg ? msg + ' ' : ''}selector ${selectorIndex}`).to.equal(selector);
if (rule.nodes!.map(x => x.toString()).join(';') !== decl) {
throw new Error(`${msg ? msg + ' ' : ''}selector ${selectorIndex} first declaration`);
}
}

export function matchAllRulesAndDeclarations(
Expand Down

0 comments on commit 80afe54

Please sign in to comment.