Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Coverage Comment failing in weird ways #1275

Closed
alexandertrefz opened this issue Aug 27, 2017 · 1 comment
Closed

Code Coverage Comment failing in weird ways #1275

alexandertrefz opened this issue Aug 27, 2017 · 1 comment
Labels

Comments

@alexandertrefz
Copy link

Issue description or question

The ignoreCoverage comment seems to not function consistently:
In VS Code:
screenshot 2017-08-27 21 10 24
In Wallabyjs App:
screenshot 2017-08-27 21 10 01

Here is the code itself for your Repro purposes: (I can paste this exact snipper into a new file and it reproduces the issue on my machine)

export enum TokenType {
	LiteralTrue   = 'LiteralTrue',
	LiteralFalse  = 'LiteralFalse',

	KeywordType  = 'KeywordType',
	KeywordIf    = 'KeywordIf',
	KeywordElse  = 'KeywordElse',
}

const getBooleanType = (value: string) => {
	if (value === 'true') {
		return TokenType.LiteralTrue
	} else if (value === 'false') {
		return TokenType.LiteralFalse
	} else {
		/* ignore coverage */
		throw new Error(`${value} is not a valid value for BooleanLiterals`)
	}
}

const getKeywordType = (value: string) => {
	if (value === 'if') {
		return TokenType.KeywordIf
	} else if (value === 'else') {
		return TokenType.KeywordElse
	} else if (value === 'type') {
		return TokenType.KeywordType
	} else {
		/* ignore coverage */
		throw new Error(`${value} is not a valid value for Keywords`)
	}
}

Wallaby.js configuration file

module.exports = function (wallaby) {
	return {
		files: [
			'src/**/*.ts',
			'!src/tests/*.ts'
		],
		tests: [
			'src/tests/*.ts'
		],
		env: {
			type: 'node'
		},
		hints: {
			ignoreCoverage: /ignore coverage/
		},
		testFramework: 'jasmine'
	}
}

Code editor or IDE name and version

Visual Studio Code Version 1.16.0-insider

OS name and version

OSX 10.12.6

@ArtemGovorov
Copy link
Member

Thanks for providing the code to reproduce the issue!

It's fixed now and the fix is published in the latest core version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants