Closed jamesshore closed 12 years ago
Please use the latest version from master. It's fixed there. This was bug #112
The real issue is having to guess at build instructions, not the build errors themselves. I take it running grunt is the correct thing to do?
At any rate, the master branch still doesn't work (commit 19225bcb52ac60fcecba7445793d311087cba873, "Angular scenario adapter - hide other outputs"):
jamesshore:testacular jshore$ node_modules/.bin/grunt
Running "build:client" (build) task
>> Created static/testacular.js
Running "build:jasmine" (build) task
>> Created adapter/jasmine.js
Running "build:mocha" (build) task
>> Created adapter/mocha.js
Running "build:ngScenario" (build) task
>> Created adapter/angular-scenario.js
Running "lint:server" (lint) task
Lint free.
Running "lint:client" (lint) task
Lint free.
Running "lint:jasmine" (lint) task
Lint free.
Running "lint:mocha" (lint) task
Lint free.
Running "lint:ngScenario" (lint) task
Lint free.
Running "lint:grunt" (lint) task
Lint free.
Running "test:unit" (test) task
Error: Cannot find module 'which'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.module.exports (/Users/jshore/Documents/Projects/testacular/tasks/test.js:15:17)
at Object.task.registerMultiTask.thisTask (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:109:15)
at Object.task.registerTask.thisTask.fn (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:343:36)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:319:9)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:346:11)
Actually--I'm not sure what happened with the which
error. I can't reproduce it. Now I'm getting a jasmine-node
error. Strangely, jasmine-node
is in my node_modules
directory.
[...]
Running "test:unit" (test) task
Error: not found: jasmine-node
at whichSync (/Users/jshore/Documents/Projects/testacular/node_modules/which/which.js:83:9)
at Object.module.exports (/Users/jshore/Documents/Projects/testacular/tasks/test.js:93:12)
at Object.task.registerMultiTask.thisTask (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:109:15)
at Object.task.registerTask.thisTask.fn (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:343:36)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:319:9)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:346:11)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:319:9)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:346:11)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:319:9)
Results of npm list
:
jamesshore:testacular jshore$ npm list
testacular@0.3.12/Users/jshore/Documents/Projects/testacular
├── chokidar@0.4.0
├── coffee-script@1.3.3
├─┬ glob@3.1.14
│ ├── graceful-fs@1.1.14
│ └── inherits@1.0.0
├─┬ grunt@0.3.17
│ ├── async@0.1.22
│ ├── colors@0.6.0-1
│ ├─┬ connect@2.4.6
│ │ ├── bytes@0.1.0
│ │ ├── cookie@0.0.4
│ │ ├── crc@0.2.0
│ │ ├── debug@0.7.0
│ │ ├── formidable@1.0.11
│ │ ├── fresh@0.1.0
│ │ ├── pause@0.0.1
│ │ ├── qs@0.5.1
│ │ └─┬ send@0.0.4
│ │ ├── mime@1.2.6
│ │ └── range-parser@0.0.4
│ ├── dateformat@1.0.2-1.2.3
│ ├── glob-whatev@0.1.8
│ ├─┬ gzip-js@0.3.1
│ │ ├── crc32@0.2.2
│ │ └── deflate-js@0.2.2
│ ├── hooker@0.2.3
│ ├─┬ jshint@0.9.1
│ │ ├── cli@0.4.3
│ │ └─┬ minimatch@0.0.5
│ │ └── lru-cache@1.0.6
│ ├─┬ nodeunit@0.7.4
│ │ └─┬ tap@0.3.1
│ │ ├── buffer-equal@0.0.0
│ │ ├── deep-equal@0.0.0
│ │ ├─┬ difflet@0.2.3
│ │ │ ├── charm@0.0.8
│ │ │ └── traverse@0.6.3
│ │ ├── inherits@1.0.0
│ │ ├── mkdirp@0.3.4
│ │ ├─┬ nopt@2.0.0
│ │ │ └── abbrev@1.0.3
│ │ ├─┬ runforcover@0.0.2
│ │ │ └─┬ bunker@0.1.2
│ │ │ └─┬ burrito@0.2.12
│ │ │ ├── traverse@0.5.2
│ │ │ └── uglify-js@1.1.1
│ │ ├── slide@1.1.3
│ │ └── yamlish@0.0.5
│ ├─┬ nopt@1.0.10
│ │ └── abbrev@1.0.3
│ ├─┬ prompt@0.1.12
│ │ ├── pkginfo@0.2.3
│ │ └─┬ winston@0.5.11
│ │ ├── eyes@0.1.8
│ │ ├─┬ loggly@0.3.11
│ │ │ ├── request@2.9.203
│ │ │ └── timespan@2.2.0
│ │ └── stack-trace@0.0.6
│ ├── semver@1.0.14
│ ├─┬ temporary@0.0.4
│ │ └── package@1.0.1
│ ├── uglify-js@1.3.3
│ ├── underscore@1.2.4
│ └── underscore.string@2.1.1
├─┬ http-proxy@0.8.3
│ ├── colors@0.6.0-1
│ └── pkginfo@0.2.3
├─┬ jasmine-node@1.0.26
│ ├── jasmine-reporters@0.2.1
│ ├── requirejs@2.1.1
│ ├── underscore@1.4.2
│ └── walkdir@0.0.5
├─┬ minimatch@0.2.7
│ └── lru-cache@2.0.4
├── mocks@0.0.8
├─┬ optimist@0.3.5
│ └── wordwrap@0.0.2
├─┬ rimraf@2.0.2
│ └── graceful-fs@1.1.14
├─┬ socket.io@0.9.10
│ ├── base64id@0.1.0
│ ├── policyfile@0.0.4
│ ├─┬ socket.io-client@0.9.10
│ │ ├─┬ active-x-obfuscator@0.0.1
│ │ │ └── zeparser@0.0.5
│ │ ├── uglify-js@1.2.5
│ │ └── xmlhttprequest@1.4.2
│ └─┬ ws@0.4.22
│ ├── commander@0.6.1
│ ├── options@0.0.3
│ └── tinycolor@0.0.1
├── which@1.0.5
└── xmlbuilder@0.4.2
I don't know about the which error but jasmine-node must be installed globally right now. (a fix is already pushed but not merged)
About docs yes they are missing but we are in the process of writing "real" docs and I'll add this to it.
In the mean time just running the default grunt task is the way to build and rum the tests. For building it is grunt build and the lint task is grunt lint. For tests there is grunt test and grunt test:unit/e2e/client. Hope this helps a bit.
That helps, thanks. grunt test:unit/e2e/client
doesn't work, though--it looks like you meant grunt test:e2e
.
Also, when I get an error, it's printed normally, then as a huge array. Is this normal? (I'm not familiar with grunt.) Example:
Running "test:unit" (test) task
/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:51
throw err;
^
SyntaxError: In /Users/jshore/Documents/Projects/testacular/test/unit/util.spec.coffee, unmatched OUTDENT on line 28
at SyntaxError (unknown source)
at Lexer.exports.Lexer.Lexer.error (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:682:13)
at Lexer.exports.Lexer.Lexer.pair (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:634:16)
at Lexer.exports.Lexer.Lexer.outdentToken (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:347:16)
at Lexer.exports.Lexer.Lexer.lineToken (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:325:14)
at Lexer.exports.Lexer.Lexer.tokenize (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:33:94)
at exports.compile.compile (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:43:32)
at Object.require.extensions..coffee (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:19:17)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
{ '0': '\n',
'1': '/',
'2': 'u',
'3': 's',
'4': 'r',
'5': '/',
'6': 'l',
'7': 'o',
'8': 'c',
'9': 'a',
'10': 'l',
'11': '/',
'12': 'l',
'13': 'i',
'14': 'b',
'15': '/',
'16': 'n',
'17': 'o',
'18': 'd',
'19': 'e',
'20': '_',
'21': 'm',
'22': 'o',
'23': 'd',
'24': 'u',
'25': 'l',
'26': 'e',
'27': 's',
'28': '/',
'29': 'j',
'30': 'a',
'31': 's',
'32': 'm',
'33': 'i',
'34': 'n',
'35': 'e',
'36': '-',
'37': 'n',
'38': 'o',
'39': 'd',
'40': 'e',
'41': '/',
'42': 'n',
'43': 'o',
'44': 'd',
'45': 'e',
'46': '_',
'47': 'm',
'48': 'o',
'49': 'd',
'50': 'u',
'51': 'l',
'52': 'e',
[...]
'1390': '3',
'1391': '1',
'1392': '2',
'1393': ':',
'1394': '1',
'1395': '2',
'1396': ')',
stdout: '',
stderr: '\n/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:51\n throw err;\n ^\nSyntaxError: In /Users/jshore/Documents/Projects/testacular/test/unit/util.spec.coffee, unmatched OUTDENT on line 28\n at SyntaxError (unknown source)\n at Lexer.exports.Lexer.Lexer.error (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:682:13)\n at Lexer.exports.Lexer.Lexer.pair (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:634:16)\n at Lexer.exports.Lexer.Lexer.outdentToken (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:347:16)\n at Lexer.exports.Lexer.Lexer.lineToken (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:325:14)\n at Lexer.exports.Lexer.Lexer.tokenize (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/lexer.js:33:94)\n at exports.compile.compile (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:43:32)\n at Object.require.extensions..coffee (/usr/local/lib/node_modules/jasmine-node/node_modules/coffee-script/lib/coffee-script/coffee-script.js:19:17)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)',
code: 1 }
<FATAL> Unit tests failed. </FATAL>
(To be clear, the error is due to a change I made. It's the error formatting that has me scratching my head.)
Okay, test:unit
and test:e2e
is working. test:client
fails:
jamesshore:testacular jshore$ grunt test:client
Running "test:client" (test) task
Error: not found: testacular
at whichSync (/Users/jshore/Documents/Projects/testacular/node_modules/which/which.js:83:9)
at Object.module.exports (/Users/jshore/Documents/Projects/testacular/tasks/test.js:99:12)
at Object.task.registerMultiTask.thisTask (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:109:15)
at Object.task.registerTask.thisTask.fn (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:343:36)
at Task.start (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/util/task.js:359:5)
at Object.grunt.tasks (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt.js:143:8)
at Object.module.exports [as cli] (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/lib/grunt/cli.js:36:9)
at Object.<anonymous> (/Users/jshore/Documents/Projects/testacular/node_modules/grunt/bin/grunt:19:14)
at Module._compile (module.js:449:26)
test:client depends global installed testacular. test:client is not dependent on testacular in its repository. This may be a somewhat strange thing.
Honestly, I never expected that many people to hack on Testacular :-D However, it's amazing.
I will put some docs together, how to build it, run the tests etc...
See #128
Globally-installed testacular did the trick. The new docs look good, too. Thanks!
I am unable to build clean using the instructions in the README (and my best guess about how to run the build). Improve the 'Development' section of the README by adding build instructions, then test it on a freshly-cloned repository with no global npm modules installed.
I tried:
Output:
I also tried
node_modules/.bin/grunt test
Output:
Running on Mac OS X Mountain Lion Node version 0.8.10 npm version 1.1.49