Socket
Socket
Sign inDemoInstall

karma-mustache-preprocessor

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-mustache-preprocessor

A preprocessor for the Karma test runner that renders HTML templates using the Mustache middleware engine.


Version published
Weekly downloads
1
Maintainers
1
Install size
3.36 kB
Created
Weekly downloads
 

Readme

Source

Karma Mustache Preprocessor

This Karma plugin will render HTML files that use the Mustache templating language.

HTML templates will be fully rendered by the time your tests execute. This allows you to make assertions on the entire document object model.

Prerequisites

  • connect-mustache-middleware

Setup

Add the following object to your Karma configuration file and modify to reflect your environment.

Ensure you point mustacheModule to the index file of the connect-mustache-middleware package.

"preprocessors": {
  "app/views/**/*.html": ["mustache"]
},
"karmaMustachePreprocessor": {
  "channel": "default",
  "mustacheModule": "lib/connect-mustache-middleware/index",
  "mustacheOpts": {
    "rootDir": "app",
    "dataDir": "mock/data",
    "datafileExt": ".json",
    "templateExt": ".html",
    "exclude": "/file/path/to/exclude/",
    "staticDataTypes": {
      "someKey": "someVar",
      "LABELS": "labels"
    }
  }
}

Keywords

FAQs

Last updated on 17 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc