Sha256: 030a2f7aa4815f00cfa3d0e72b2c67164948742321922d4eac3e9aec46eb51f5

Contents?: true

Size: 1.48 KB

Versions: 6

Compression:

Stored size: 1.48 KB

Contents

module.exports = function (grunt) {
  var allSassFiles = []

  grunt.file.recurse(
    './stylesheets/',
    function (abspath, rootdir, subdir, filename) {
      var relpath
      if (typeof subdir !== 'undefined') {
        relpath = subdir + '/' + filename
      } else {
        relpath = filename
      }
      if (filename.match(/\.scss/)) {
        allSassFiles.push("@import '" + relpath + "';")
      }
    }
  )

  grunt.file.write(
    './spec/stylesheets/test.scss',
    allSassFiles.join('\n')
  )

  grunt.initConfig({
    clean: {
      sass: ['spec/stylesheets/test*css']
    },
    jasmine: {
      javascripts: {
        src: [
          'node_modules/jquery/dist/jquery.js',
          'javascripts/govuk/analytics/google-analytics-universal-tracker.js',
          'javascripts/govuk/analytics/analytics.js',
          'javascripts/**/*.js'
        ],
        options: {
          specs: 'spec/unit/**/*.spec.js',
          helpers: 'spec/unit/*.helper.js'
        }
      }
    },
    sass: {
      development: {
        files: {
          './spec/stylesheets/test-out.css': './spec/stylesheets/test.scss'
        },
        options: {
          loadPath: [
            './stylesheets'
          ],
          style: 'nested'
        }
      }
    }
  })

  grunt.loadNpmTasks('grunt-contrib-clean')
  grunt.loadNpmTasks('grunt-contrib-jasmine')
  grunt.loadNpmTasks('grunt-contrib-sass')

  grunt.registerTask('test', ['sass', 'clean', 'jasmine'])
  grunt.registerTask('default', ['test'])
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-5.1.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-5.0.3 app/assets/Gruntfile.js
govuk_frontend_toolkit-5.0.2 app/assets/Gruntfile.js
govuk_frontend_toolkit-5.0.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-5.0.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.18.4 app/assets/Gruntfile.js