Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make test pass
  • Loading branch information
JacksonTian committed Oct 26, 2018
1 parent 54f24ea commit 04e1e53
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 373 deletions.
15 changes: 10 additions & 5 deletions Makefile
@@ -1,25 +1,30 @@
TESTS = test/*.js
REPORTER = spec
TIMEOUT = 20000
ISTANBUL = ./node_modules/.bin/istanbul
PATH := ./node_modules/.bin:$(PATH)
MOCHA = ./node_modules/mocha/bin/_mocha
COVERALLS = ./node_modules/coveralls/bin/coveralls.js

clean:
@rm -rf node_modules

test:
@NODE_ENV=test $(MOCHA) -r should -R $(REPORTER) -t $(TIMEOUT) \
@mocha -r should -R $(REPORTER) -t $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-debug:
@mocha --debug-brk -r should -R $(REPORTER) -t $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov:
@$(ISTANBUL) cover --report html $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)
@istanbul cover --report html $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)

test-coveralls:
@$(ISTANBUL) cover --report lcovonly $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)
@istanbul cover --report lcovonly $(MOCHA) -- -t $(TIMEOUT) -r should -R spec $(TESTS)
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@cat ./coverage/lcov.info | $(COVERALLS) && rm -rf ./coverage
@cat ./coverage/lcov.info | coveralls && rm -rf ./coverage

test-all: test test-coveralls

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -57,7 +57,7 @@ var express = require('express'),
// use ejs-locals for all ejs templates:
app.engine('ejs', engine);

app.set('views',__dirname + '/views');
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs'); // so you can render('index')

// render 'index' into 'boilerplate':
Expand Down
25 changes: 25 additions & 0 deletions lib/block.js
@@ -0,0 +1,25 @@
'use strict';

class Block {
constructor() {
this.html = [];
}

toString() {
return this.html.join('\n');
}

append(more) {
this.html.push(more);
}

prepend(more) {
this.html.unshift(more);
}

replace(instead) {
this.html = [ instead ];
}
}

module.exports = Block;

0 comments on commit 04e1e53

Please sign in to comment.