diff --git a/ass-stubs/server-test.js b/ass-stubs/server-test.js
index 8cd9c88..1c3c462 100644
--- a/ass-stubs/server-test.js
+++ b/ass-stubs/server-test.js
@@ -1,3 +1,5 @@
-require('ass'); require('../server.js');
+// We don't require ass because we can't test a majority of the server reliably.
+//require('ass');
+require('../server.js');
console.log('done');
process.on('SIGTERM', function() { process.exit(0); });
diff --git a/coverage.svg b/coverage.svg
index 0122874..36e8404 100644
--- a/coverage.svg
+++ b/coverage.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/test.js b/test.js
index 923efe0..29345f9 100644
--- a/test.js
+++ b/test.js
@@ -50,7 +50,6 @@ describe('the CLI', function() {
child = cproc.spawn('node',
['ass-stubs/cli-test.js', 'cactus', 'grown', '.png']);
child.stdout.on('data', function(chunk) {
- var buffer = ''+chunk;
// Check the PNG magic number.
chunk[0].should.equal(0x89);
chunk[1].should.equal(0x50);
@@ -67,6 +66,7 @@ describe('the CLI', function() {
describe('the server', function() {
var port = '1111';
+ var url = 'http://127.0.0.1:' + port + '/';
var server;
// Start running the server.
@@ -77,7 +77,7 @@ describe('the server', function() {
});
it('should produce colorscheme badges', function(done) {
- http.get('http://127.0.0.1:' + port + '/:fruit-apple-green.svg',
+ http.get(url + ':fruit-apple-green.svg',
function(res) {
var buffer = '';
res.on('data', function(chunk) { buffer += ''+chunk; });
@@ -90,6 +90,24 @@ describe('the server', function() {
});
});
+ it('should produce colorscheme PNG badges', function(done) {
+ http.get(url + ':fruit-apple-green.png',
+ function(res) {
+ res.on('data', function(chunk) {
+ // Check the PNG magic number.
+ chunk[0].should.equal(0x89);
+ chunk[1].should.equal(0x50);
+ chunk[2].should.equal(0x4e);
+ chunk[3].should.equal(0x47);
+ chunk[4].should.equal(0x0d);
+ chunk[5].should.equal(0x0a);
+ chunk[6].should.equal(0x1a);
+ chunk[7].should.equal(0x0a);
+ done();
+ });
+ });
+ });
+
it('should shut down', function(done) {
server.kill();
server.on('exit', function() { done(); });