User story
As a developer I want to have a good signal to noise ration and want to write my tests with as less boilerplate as possible.
Paths are environment specific and cause boilerplate to get properly tested.
Therefor I need a custom matcher for paths.
Existing helper:
os-agnostic-paths
Bad example:
expect(osAgnosticPath(process.cwd())).toEqual(expect.stringContaining(osAgnosticPath('project-root/other-folder'),),);Suggested matcher:
expect(myPath).toContainPath('...')expect(myPath).toEndWithPath('...')
Good example:
// windows 'C:\Documnets\my-projects\project-root'// linux '/home/my-projects/project-root'expect(process.cwd()).toContainPath('project-root/other-folder');expect(process.cwd()).toEndsWithPath('project-root/other-folder/src');Acceptance criteria
I want to be able to use the custom matcher in the following libs:
Internal logic:
User story
As a developer I want to have a good signal to noise ration and want to write my tests with as less boilerplate as possible.
Paths are environment specific and cause boilerplate to get properly tested.
Therefor I need a custom matcher for paths.
Existing helper:
os-agnostic-paths
Bad example:
Suggested matcher:
expect(myPath).toContainPath('...')expect(myPath).toEndWithPath('...')Good example:
Acceptance criteria
I want to be able to use the custom matcher in the following libs:
Internal logic:
I want to be able to have different matcher present:
toContainPath('...')toEndWithPath('...')