Skip to content

Instantly share code, notes, and snippets.

@freizl
Created October 23, 2015 22:04
Show Gist options
  • Save freizl/b0a7ae4cffbb7f6c5310 to your computer and use it in GitHub Desktop.
Save freizl/b0a7ae4cffbb7f6c5310 to your computer and use it in GitHub Desktop.

Set up

  • install karma
  • karma init

karma.conf.js

  • basePath: dir where karma loading files to its cache

  • files: what files shall be loaded into cache from basePath

    • /path/to/an/file
    • /path/to/some/**/*.file
    • { pattern: 'src/foo/**/*.js', included: false, served: true } load files to __karma__.file but not load to browser. good for requirejs case. (file shall be loaded into browser by requirejs)
  • exclude: specific files shall be excluded.

test-main-for-require.js

  • deps: test spec files
  • baseUrl: usually it's just /base by default. sort of hard config.
  • paths, map, shim: requirejs config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment