-
Notifications
You must be signed in to change notification settings - Fork 343
Closed
Labels
feature requestUser requests a new featureUser requests a new feature
Description
Further to a discussion I had recently with @36degrees and an initial proposal at #1089
For projects acting as a port of the nunjucks templates, in a different templating language, it would be useful to be able to run your unit tests as a 'spec' against a custom render function, to ensure the port has feature parity with the govuk-frontend nunjucks templates.
This would require:
- component/component.yaml being copied across to package build (perhaps as json to make it easier to include from parent projects
- unit tests to be moved in to a separate file (e.g. template.spec.js) that don't auto-execute when required, as per WIP: export tests as a 'spec' #1089, but still have template.unit.js execute them when running in govuk-frontend.
- allow a custom render function to be passed in
- discuss whether a custom render function should return a string or a pre-wrapped cheerio object
- either don't use axe-helper.js in the exported spec (assume it has already been configured) or move it in to distributed package (it currently sits under /lib and is not available in the distributed/npm version)
- move get-examples.js to a location so that it is available in the distributed/npm package
Related: jestjs/jest#7501
Metadata
Metadata
Assignees
Labels
feature requestUser requests a new featureUser requests a new feature