<commit_before>module.exports = (grunt) ->
  jasmineRequireTemplate = require 'grunt-template-jasmine-requirejs'
  jasmineIstanbulTemplate = require 'grunt-template-jasmine-istanbul'

  jasmineSpecRunner = 'spec-runner.html'
  coverageSpecRunner = 'coverage-runner.html'

  sourcePath = 'src/js/**/*.js'

  testRequireConfig = 'test/js/js-test-require-config.js'
  specs = 'test/js/spec/**/*.js'
  styles = 'bower_components/hp-autonomy-js-testing-utils/src/css/bootstrap-stub.css'
  serverPort = 8000
  host = "http://localhost:#{serverPort}/"

  grunt.initConfig
    pkg: grunt.file.readJSON 'package.json'
    clean: [
      jasmineSpecRunner
      coverageSpecRunner
      'bin'
      '.grunt'
    ]
    connect:
      server:
        options:
          port: serverPort
    jasmine:
      test:
        src: sourcePath
        options:
          host: host
          keepRunner: true
          outfile: jasmineSpecRunner
          specs: specs
          styles: styles
          template: jasmineRequireTemplate
          templateOptions:
            requireConfigFile: testRequireConfig
      coverage:
        src: sourcePath
        options:
          host: host
          keepRunner: true
          outfile: coverageSpecRunner
          specs: specs
          styles: styles
          template: jasmineIstanbulTemplate
          templateOptions:
            coverage: 'bin/coverage/coverage.json'
            replace: false
            report:
              type: 'text'
            template: jasmineRequireTemplate
            templateOptions:
              requireConfigFile: testRequireConfig
              requireConfig:
                config:
                  instrumented: {
                    src: grunt.file.expand(sourcePath)
                  }
                callback: () ->
                  define('instrumented', ['module'], (module) ->
                    module.config().src
                  )
                  require ['instrumented'], (instrumented) ->
                    oldLoad = requirejs.load
                    requirejs.load = (context, moduleName, url) ->
                      if url.substring(0, 1) == '/'
                        url = url.substring 1<commit_msg>Add the custom matchers as a spec helper so they actually work. [rev: matthew.gordon2]<commit_after>module.exports = (grunt) ->
  jasmineRequireTemplate = require 'grunt-template-jasmine-requirejs'
  jasmineIstanbulTemplate = require 'grunt-template-jasmine-istanbul'

  jasmineSpecRunner = 'spec-runner.html'
  coverageSpecRunner = 'coverage-runner.html'

  sourcePath = 'src/js/**/*.js'

  testRequireConfig = 'test/js/js-test-require-config.js'
  specs = 'test/js/spec/**/*.js'
  styles = 'bower_components/hp-autonomy-js-testing-utils/src/css/bootstrap-stub.css'
  serverPort = 8000
  host = "http://localhost:#{serverPort}/"
  helpers = 'bower_components/hp-autonomy-js-testing-utils/src/js/jasmine-custom-matcher.js'

  grunt.initConfig
    pkg: grunt.file.readJSON 'package.json'
    clean: [
      jasmineSpecRunner
      coverageSpecRunner
      'bin'
      '.grunt'
    ]
    connect:
      server:
        options:
          port: serverPort
    jasmine:
      test:
        src: sourcePath
        options:
          helpers: helpers
          host: host
          keepRunner: true
          outfile: jasmineSpecRunner
          specs: specs
          styles: styles
          template: jasmineRequireTemplate
          templateOptions:
            requireConfigFile: testRequireConfig
      coverage:
        src: sourcePath
        options:
          helpers: helpers
          host: host
          keepRunner: true
          outfile: coverageSpecRunner
          specs: specs
          styles: styles
          template: jasmineIstanbulTemplate
          templateOptions:
            coverage: 'bin/coverage/coverage.json'
            replace: false
            report:
              type: 'text'
            template: jasmineRequireTemplate
            templateOptions:
              requireConfigFile: testRequireConfig
              requireConfig:
                config:
                  instrumented: {
                    src: grunt.file.expand(sourcePath)
                  }
                callback: () ->
                  define('instrumented', ['module'], (module) ->
                    module.config().src
                  )
                  require ['instrumented'], (instrumented) ->
                    oldLoad = requirejs.load
                    requirejs.load = (context, moduleName, url) ->
                      if url.substring(0, 1) == '/'
                        url = url.substring 1
{'fraction_non_alphanumeric': 0.09257660768234786, 'fraction_numerical': 0.0032369443245576176, 'mean_word_length': 1.6730103806228374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5675648', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1217, 'n_words': 242}