-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from RobLoach/tests
Add automated tests
- Loading branch information
Showing
5 changed files
with
176 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# CompileTest | ||
safeps = require('safeps') | ||
joe = require('joe') | ||
pathUtil = require('path') | ||
fs = require('fs') | ||
{expect} = require('chai') | ||
|
||
# ------------------------------------- | ||
# Configuration | ||
|
||
# Paths | ||
projectzPath = pathUtil.join(__dirname, '..', '..') | ||
testPath = pathUtil.join(projectzPath, 'test') | ||
srcPath = pathUtil.join(projectzPath, 'test', 'src') | ||
expectPath = pathUtil.join(projectzPath, 'test', 'out-expected') | ||
cliPath = pathUtil.join(projectzPath, 'bin', 'projectz') | ||
|
||
# ------------------------------------- | ||
# Tests | ||
|
||
joe.suite 'projectz-compile', (suite,test) -> | ||
test 'compile', (done) -> | ||
|
||
# Compile with Projectz using -p to switch to the source path. | ||
command = [cliPath, 'compile', '-p', srcPath] | ||
safeps.spawnCommand 'node', command, {output:true}, (err) -> | ||
return done(err) if err | ||
|
||
# Check that the compiled files match correctly. | ||
suite 'files', (suite,test) -> | ||
for file in fs.readdirSync(expectPath) | ||
# Ensure the file context is kept across the asyncronous calls. | ||
((file) -> | ||
test file, (done) -> | ||
# Load the expected source. | ||
fs.readFile pathUtil.join(expectPath, file), 'utf8', (err, expected) -> | ||
return done(err) if err | ||
# Load the actual source. | ||
fs.readFile pathUtil.join(srcPath, file), 'utf8', (err, actual) -> | ||
return done(err) if err | ||
expect(actual).to.equal(expected) | ||
done() | ||
)(file); | ||
done() |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "ambi", | ||
"version": "2.1.4", | ||
"description": "Execute a function ambidextrously (normalizes the differences between synchronous and asynchronous functions). Useful for treating synchronous functions as asynchronous functions (like supporting both synchronous and asynchronous event definitions automatically).", | ||
"homepage": "https://github.com/bevry/ambi", | ||
"keywords": [ | ||
"sync", | ||
"async", | ||
"fire", | ||
"exec", | ||
"execute", | ||
"ambidextrous", | ||
"flow" | ||
], | ||
"author": "Bevry Pty Ltd <us@bevry.me> (http://bevry.me)", | ||
"maintainers": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)" | ||
], | ||
"contributors": [ | ||
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)", | ||
"sfrdmn (https://github.com/sfrdmn)" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/bevry/ambi/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/bevry/ambi.git" | ||
}, | ||
"license": { | ||
"type": "MIT" | ||
}, | ||
"engines": { | ||
"node": ">=0.8" | ||
}, | ||
"dependencies": { | ||
"typechecker": "~2.0.6" | ||
}, | ||
"devDependencies": { | ||
"coffee-script": "~1.6.2", | ||
"joe": "~1.3.0", | ||
"joe-reporter-console": "~1.2.0", | ||
"chai": "~1.7.2" | ||
}, | ||
"directories": { | ||
"lib": "./out/lib" | ||
}, | ||
"scripts": { | ||
"preinstall": "node ./cyclic.js", | ||
"test": "node ./out/test/everything-test.js" | ||
}, | ||
"main": "./out/lib/ambi.js" | ||
} |
This file was deleted.
Oops, something went wrong.