https://github.com/spirosikmd/nghtml2js-jest
Jest preprocessor to turn Angular 1 templates into JS and put in modules.
https://github.com/spirosikmd/nghtml2js-jest
angular1 angularjs jest nghtml2js
Last synced: 3 months ago
JSON representation
Jest preprocessor to turn Angular 1 templates into JS and put in modules.
- Host: GitHub
- URL: https://github.com/spirosikmd/nghtml2js-jest
- Owner: spirosikmd
- License: mit
- Created: 2017-10-12T17:06:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T10:02:51.000Z (over 2 years ago)
- Last Synced: 2025-02-01T01:25:02.732Z (3 months ago)
- Topics: angular1, angularjs, jest, nghtml2js
- Language: JavaScript
- Homepage:
- Size: 860 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# nghtml2js-jest
Jest preprocessor to turn Angular 1 templates into JS and put in modules.
[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![PRs Welcome][prs-badge]](http://makeapullrequest.com)
[![All Contributors][all-contributors-badge]](#contributors)## Install
`npm install --save-dev ng-html2js nghtml2js-jest`
or
`yarn add ng-html2js nghtml2js-jest --dev`
## Example
Assuming the project uses babel, create a `jest.json` file and use the `nghtml2js-jest` preprocessor to transform html files.
The `test/setup.js` file will probably be needed to import `angular` and `angular-mocks`.```json
{
"bail": true,
"verbose": true,
"transform": {
"^.+\\.js$": "babel-jest",
"^.+\\.html$": "/node_modules/nghtml2js-jest/preprocessor.js"
},
"moduleFileExtensions": [
"js"
],
"setupTestFrameworkScriptFile": "/test/setup.js"
}
```For a more complete example have a look at the [example](https://github.com/spirosikmd/nghtml2js-jest/tree/master/example) folder.
## Contributors
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):
| [
Spyros Ioakeimidis](http://www.spyros.io)
[💬](#question-spirosikmd "Answering Questions") [💻](https://github.com/spirosikmd/nghtml2js/commits?author=spirosikmd "Code") [⚠️](https://github.com/spirosikmd/nghtml2js/commits?author=spirosikmd "Tests") |
| :---: |This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification.
Contributions of any kind welcome![version-badge]: https://img.shields.io/npm/v/nghtml2js-jest.svg?style=flat-square
[package]: https://www.npmjs.com/package/nghtml2js-jest
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[build-badge]: https://img.shields.io/travis/spirosikmd/nghtml2js-jest.svg?style=flat-square
[build]: https://travis-ci.org/spirosikmd/nghtml2js-jest.svg
[all-contributors-badge]: https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square
[greenkeeper-badge]: https://badges.greenkeeper.io/spirosikmd/nghtml2js-jest.svg