Skip to content

Commit

Permalink
Do not require a global babel install in the Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjeffburke committed Mar 29, 2018
1 parent a92f38f commit 9d4a82c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,29 @@ lint:
.PHONY: lint

build/lib: lib/*
babel --copy-files --out-dir build/lib --quiet lib
./node_modules/.bin/babel --copy-files --out-dir build/lib --quiet lib

build/test: $(shell find test -type f)
BABEL_ENV=test babel --copy-files --out-dir build/test --quiet test
BABEL_ENV=test ./node_modules/.bin/babel --copy-files --out-dir build/test --quiet test
sed -i -e 's#--require ./test#--require ./build/test#g' ./build/test/mocha.opts

build/externaltests: externaltests/*
babel --copy-files --out-dir build/externaltests --quiet externaltests
./node_modules/.bin/babel --copy-files --out-dir build/externaltests --quiet externaltests

build: build/lib build/test build/externaltests

.PHONY: ${TARGETS}
${TARGETS}: build
./node_modules/.bin/rollup --config rollup.config.js --sourcemap --format umd --name weknowhow.expect -o unexpected.js build/lib/index.js

.PHONY: create-html-runners
create-html-runners: build/test test/tests.tpl.html test/JasmineRunner.tpl.html
@for file in tests JasmineRunner ; do \
(sed '/test files/q' ./build/test/$${file}.tpl.html | sed '$$d' && \
find test -name '*.spec.js' | sed 's/test/ <script src="./' | sed 's/$$/"><\/script>/' && \
sed -n '/test files/,$$p' ./build/test/$${file}.tpl.html | sed '1d') > ./build/test/$${file}.html;\
done

.PHONY: create-html-runners

test-phantomjs: build/test create-html-runners ${TARGETS}
phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js build/test/tests.html spec "`node -pe 'JSON.stringify({useColors:true,grep:process.env.grep})'`"

Expand Down

0 comments on commit 9d4a82c

Please sign in to comment.