I learned about Google's closing tools by writing a simple JavaScript game. I find it hard to figure out how to configure jsTestDriver to work well with the closure library.
In particular: I would like to use the goog.require mechanism to include any additional JavaScript files, rather than manually adding them to the configuration file.
Following meyertee's suggestion, I made a simple script to automatically write dependencies to a configuration file
#!/bin/bash cp tests/jsTestDriver.conf.proto tests/jsTestDriver.conf libs/closure-library/closure/bin/build/closurebuilder.py --root="./libs/closure-library" --root="./js" --namespace="lds" | sed "s#^# - \.\./#" >> tests/jsTestDriver.conf
The file test / jsTestDriver.conf.proto is a simple template:
test: - "*.js" load: - ../libs/knockout-2.1.0.js
This is a very fragile script, but hopefully someone (except me) finds it useful.
Odalrick
source share