Last active
November 18, 2021 05:09
-
-
Save gparlakov/0b9b94f8140687bb3b1db1772503bd0d to your computer and use it in GitHub Desktop.
A function template example for scuri (use with config or --functionTemplate my/path/to/function.template)
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
This template demostrates how to apply functions to the file name. | |
Functions from https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/core/src/utils/strings.ts |
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
/** | |
* CUSTOM FUNCTION TEMPLATE | |
* AVAILABLE PROPERTIES: | |
* specFileName: <%= specFileName %> | |
* normalizedName: <%= normalizedName %> (fileName.ext) ->normalize-> fileName | |
* name: <%= name %> | |
*/ | |
describe('<%= name %> (is a function!)', () => { | |
it('should mostly work', () => { | |
const result = <%= name %>(); | |
expect(result).toBe(42); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment