Skip to content

Instantly share code, notes, and snippets.

@dignifiedquire
Last active December 14, 2015 03:18
Show Gist options
  • Save dignifiedquire/5019406 to your computer and use it in GitHub Desktop.
Save dignifiedquire/5019406 to your computer and use it in GitHub Desktop.
Testacular Configuration in YAML

New Testacular Configuration File

The idea is to use a parsed rather than a evaluated configuration file to make the whole process safer and cleaner.

Requirements

  • Simple, readable format with little to no overhead.
  • Access to environment variables.
  • Sharing of configuration between multiple files.

Solution

  • YAML based configuration file.
  • Preprocessed for string interpolation: {{ENV.PHANTOMJS_BIN}} --> /path/to/phantomjs/bin
  • First load ~/.testacular and then testacular.yml or the specified configuration file and merge them with the latter taking precedence over the former.
# This is a translation of a current Testacular configuration file
# Testacular configuration
# base path, that will be used to resolve files and exclude
basePath: sample/path/
# list of files / patterns to load in the browser
files: [
file1,
file2,
nested/file3
]
# list of files to exclude
exclude: [
exclude/me.txt
]
# test results reporter to use
# possible values: dots, progress, junit
reporters = [progress, junit];
# web server port
port: 9876
# cli runner port
runnerPort: 9100
// enable / disable colors in the output (reporters and logs)
colors: true
# level of logging
logLevel: info
# enable / disable watching file and executing tests whenever any file changes
autoWatch: false
# Start these browsers
# with environment variable PHANTOMJS_BIN=/path/to/phantomjs/bin
browsers: [ Chrome, ChromeCanary, {{ENV.PHANTOMJS_BIN}}]
# If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000
# Continuous Integration mode
# if true, it capture browsers, run tests and exit
singleRun: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment