busterjs/buster — Issue #75: Problems locating source scripts
Author: Integralist
Created: 2012-02-16 11:54:05+00:00
State: open

Hello,

My set-up: Buster version `1.1.0-3` on `Mac OS X 10.7.3`.

I have the following file structure…

* example.js
* /test/
* buster.js
* example-test.js

…and the content of `buster.js` is:

```js
var config = module.exports;

config['My tests'] = {
environment: 'browser',
sources: [
'../example.js'
],
tests: [
"*-test.js"
]
}
```

The content of `example-test.js` is:

```js
buster.testCase('My test module', {

/*
setUp: function (done) {

},

tearDown: function (done) {

},
*/

'should assert true': function(){
var user = canDrink(18);
assert(user);
}

});
```

The content of the file `example.js` is:

```js
function canDrink(age) {
if (typeof age != 'number') {
age = parseInt(age);
}
return (age >= 18) ? true : false;
}
```

It was a silly example I knocked together to get an idea of how to run tests using Buster.js but when I execute the command `buster test` I get an error about `ReferenceError: Undefined variable: canDrink`.