Last active
August 29, 2015 14:02
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "analytics", | |
"dependencies": {...} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = analytics; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "analytics-tests", | |
"dependencies": { | |
"component/assert": "0.x" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="analytics.js"></script> | |
<script src="test-build.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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