Skip to content

Commit

Permalink
Using beforeeach in test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
akamud committed Dec 7, 2015
1 parent cd015f3 commit 1858c18
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,29 @@ import * as vscode from 'vscode';
import {CanIUse} from '../can-i-use';

suite("Can I Use Tests", () => {
var canIUseExt;

beforeEach(() => {
canIUseExt = new CanIUse();
});

test("Get rule from dictionary", () => {
let canIUseExt = new CanIUse();

assert.equal(canIUseExt.getNormalizedRule("animation-name"), "css-animation");
});

test("Get word when rule is not in the dictionary", () => {
let canIUseExt = new CanIUse();

assert.equal(canIUseExt.getNormalizedRule("outline"), "outline");
});

test("Get rule from dictionary case insensitively", () => {
let canIUseExt = new CanIUse();

assert.equal(canIUseExt.getNormalizedRule("scaleZ"), "transforms3d");
});

test("Get well-supported property", () => {
let canIUseExt = new CanIUse();

assert.equal(canIUseExt.isWellSupported(canIUseExt.getNormalizedRule("background-color")), true);
});

test("New properties won't show as well supported", () => {
let canIUseExt = new CanIUse();

assert.equal(canIUseExt.isWellSupported(canIUseExt.getNormalizedRule("animation-name")), false);
});
});

0 comments on commit 1858c18

Please sign in to comment.