karma-story-reporter
Version:
A Karma plugin. Report results in BDD-style story format.
84 lines (61 loc) • 1.76 kB
JavaScript
describe("Initial spec", function() {
'use strict';
describe("Initial spec nested", function() {
it("has a passing child test", function() {
expect(':)').toMatch(/.*/);
});
});
});
describe("Story reporter", function() {
"use strict";
it("has a first test that passes", function() {
expect(true).toBeTruthy();
});
it("has a first test that fails", function() {
expect(true).toBeFalsy();
});
describe("nested spec", function() {
it("has a passing child test", function() {
expect(1).toBe(1);
});
});
describe("with deeply nested spec", function() {
it("has an initial test that passes", function() {
expect(null).toBeNull();
});
it("has a test that fails", function() {
expect(null).not.toBeNull();
});
describe("nested further", function() {
it("has a passing child test", function() {
expect(1).toBeGreaterThan(0);
});
describe("and even further", function() {
it("has a passing child test", function() {
expect(0).toBeLessThan(1);
});
});
});
describe("with a failing child spec", function() {
it("passes this test", function() {
expect([true, false]).toContain(true);
});
describe("with failing test", function() {
it("fails this test", function() {
expect(false).toBeTruthy();
});
describe("child of failing test", function() {
it("passes this test", function() {
expect(undefined).toBeUndefined();
});
});
});
});
});
});
describe("Final spec", function() {
'use strict';
it("has a passing child test", function() {
expect(':)').toMatch(/.*/);
});
});