Last active
July 2, 2018 09:45
-
-
Save BadgerCode/3d41966f03dcfb38975da5d63e72d225 to your computer and use it in GitHub Desktop.
Jasmine describe extensions for parameterised describes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function testCase(...testParameters: any[]) { | |
// Syntactic sugar function | |
return testParameters; | |
} | |
export function testCases(...testCases: any[]){ | |
// Syntactic sugar function | |
return testCases; | |
} | |
export function fdescribeWithParams(message: string, testCases: any[][], describeCallback: ((testParameters: any[]) => void)) { | |
testCases.forEach(testParameters => { | |
fdescribe(`${message} [${testParameters}]`, () => { | |
describeCallback(testParameters); | |
}); | |
}); | |
} | |
export function describeWithParams(message: string, testCases: any[][], describeCallback: ((testParameters: any[]) => void)) { | |
testCases.forEach(testParameters => { | |
describe(`${message} [${testParameters}]`, () => { | |
describeCallback(testParameters); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: