Skip to content

Commit

Permalink
test(fixtures): add another file to the testing sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Lewis committed Apr 15, 2017
1 parent deba426 commit 7f1cc4d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
7 changes: 7 additions & 0 deletions test/fixtures/typescript/src/another-file.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class Bam {

method() {
console.log('hello world!');
}

}
3 changes: 3 additions & 0 deletions test/fixtures/typescript/src/example.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* tslint:disable */
import {Bam} from './another-file';

export class Foo {

bam: Bam = new Bam();

bar(): boolean {
return true; //covered
}
Expand Down
30 changes: 15 additions & 15 deletions test/reporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,22 @@ describe('karma-coverage-istanbul-reporter', () => {
const summary = JSON.parse(fs.readFileSync(OUTPUT_FILE));
expect(summary.total).to.deep.equal({
lines: {
total: 6,
covered: 5,
total: 11,
covered: 9,
skipped: 0,
pct: 83.33
pct: 81.82
},
statements: {
total: 6,
covered: 5,
total: 11,
covered: 9,
skipped: 0,
pct: 83.33
pct: 81.82
},
functions: {
total: 3,
covered: 2,
total: 5,
covered: 3,
skipped: 0,
pct: 66.67
pct: 60
},
branches: {
total: 0,
Expand Down Expand Up @@ -149,9 +149,9 @@ describe('karma-coverage-istanbul-reporter', () => {

function checkOutput() {
const output = fs.readFileSync(OUTPUT_LOG_FILE).toString();
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for statements (83.33%) does not meet global threshold (100%)');
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for lines (83.33%) does not meet global threshold (100%)');
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for functions (66.67%) does not meet global threshold (100%)');
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for statements (81.82%) does not meet global threshold (100%)');
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for lines (81.82%) does not meet global threshold (100%)');
expect(output).to.contain('[ERROR] reporter.coverage-istanbul - Coverage for functions (60%) does not meet global threshold (100%)');
done();
}

Expand All @@ -177,9 +177,9 @@ describe('karma-coverage-istanbul-reporter', () => {

function checkOutput() {
const output = fs.readFileSync(OUTPUT_LOG_FILE).toString();
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for statements (83.33%) does not meet global threshold (50%)');
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for lines (83.33%) does not meet global threshold (50%)');
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for functions (66.67%) does not meet global threshold (50%)');
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for statements (81.82%) does not meet global threshold (50%)');
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for lines (81.82%) does not meet global threshold (50%)');
expect(output).not.to.contain('[ERROR] reporter.coverage-istanbul - Coverage for functions (60%) does not meet global threshold (50%)');
done();
}

Expand Down

0 comments on commit 7f1cc4d

Please sign in to comment.