Skip to content

Instantly share code, notes, and snippets.

@ianstormtaylor
Last active August 29, 2015 14:02
Show Gist options
  • Save ianstormtaylor/d9b432215f5d0416d109 to your computer and use it in GitHub Desktop.
Save ianstormtaylor/d9b432215f5d0416d109 to your computer and use it in GitHub Desktop.
This is what we would do with Analytics.js tests, since we actually want to be testing the physical built file itself, we're actually a layer above Duo because we're trying to test the Duo build process, which normal module testing shouldn't concern itself with. Use `-` in filenames instead of `/` since Gist has limitations.
{
"name": "analytics",
"dependencies": {...}
}
module.exports = analytics;
build: index.js
duo index.js --global analytics > analytics.js
test: index.js test-index.js
duo test-index.js > test-build.js
open test-index.html # which adds both builds via <script> tags
{
"name": "analytics-tests",
"dependencies": {
"component/assert": "0.x"
}
}
<script src="analytics.js"></script>
<script src="test-build.js"></script>
var analytics = window.analytics;
var assert = require('component/assert');
// Tests here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment