jacopotarantino/Lovelace

View on GitHub
spec/node/scripts_spec.coffee

Summary

Maintainability
Test Coverage
'use strict'

Lovelace = require('../../index').init
  root_component_path: "#{process.env.PWD}/components"

rendered = Lovelace.scripts()

describe 'Lovelace.scripts', ->
  describe 'when working in node', ->
    it 'should compile coffeescript files and return a script block', ->
      expect( rendered.indexOf '<script>(function' ).toBe(0)

    it 'should return all the available scripts, not just one', ->
      expect( rendered.indexOf('Primary') > 0 ).toBeTruthy()
      expect( rendered.indexOf('Secondary') > 0 ).toBeTruthy()