mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-25 12:20:24 -04:00
Use npm exclusively (not make) to run tests
This commit is contained in:
parent
adf5a5838e
commit
a92abd4910
2 changed files with 7 additions and 63 deletions
58
Makefile
58
Makefile
|
@ -3,10 +3,8 @@ NODE= NODE_OPTIONS=--max_old_space_size=8000 node
|
|||
SCRATCH_DOCKER_CONFIG=./node_modules/.bin/docker_config.sh
|
||||
S3CMD=s3cmd sync -P --delete-removed --add-header=Cache-Control:no-cache,public,max-age=3600
|
||||
TAP=./node_modules/.bin/tap
|
||||
WATCH= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/watch
|
||||
WEBPACK= NODE_OPTIONS=--max_old_space_size=8000 ./node_modules/.bin/webpack
|
||||
|
||||
|
||||
# ------------------------------------
|
||||
|
||||
$(SCRATCH_DOCKER_CONFIG):
|
||||
|
@ -21,28 +19,10 @@ docker-down:
|
|||
|
||||
# ------------------------------------
|
||||
|
||||
build:
|
||||
@make clean
|
||||
@make translations
|
||||
@make webpack
|
||||
|
||||
clean:
|
||||
rm -rf ./build
|
||||
rm -rf ./intl
|
||||
mkdir -p build
|
||||
mkdir -p intl
|
||||
|
||||
deploy:
|
||||
@make build
|
||||
@make sync
|
||||
|
||||
translations:
|
||||
./bin/get-localized-urls localized-urls.json
|
||||
./bin/build-locales node_modules/scratch-l10n/www intl
|
||||
|
||||
webpack:
|
||||
$(WEBPACK) --bail
|
||||
|
||||
sync-s3:
|
||||
$(S3CMD) --exclude '.DS_Store' --exclude '*.svg' --exclude '*.js' ./build/ s3://$(S3_BUCKET_NAME)/
|
||||
$(S3CMD) --exclude '*' --include '*.svg' --mime-type 'image/svg+xml' ./build/ s3://$(S3_BUCKET_NAME)/
|
||||
|
@ -57,40 +37,4 @@ sync:
|
|||
|
||||
# ------------------------------------
|
||||
|
||||
start:
|
||||
$(NODE) ./dev-server/index.js
|
||||
|
||||
# ------------------------------------
|
||||
|
||||
test:
|
||||
@make lint
|
||||
@make build
|
||||
@make tap
|
||||
|
||||
lint:
|
||||
$(ESLINT) . --ext .js,.jsx,.json
|
||||
|
||||
unit:
|
||||
$(TAP) ./test/unit/*.js --no-coverage -R classic
|
||||
|
||||
integration:
|
||||
$(TAP) ./test/integration/*.js --no-coverage -R classic
|
||||
|
||||
smoke:
|
||||
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600 --no-coverage -R classic
|
||||
|
||||
smoke-verbose:
|
||||
$(TAP) ./test/integration/smoke-testing/*.js --timeout=3600 -R spec --no-coverage -R classic
|
||||
|
||||
localization:
|
||||
$(TAP) ./test/localization/*.js --no-coverage -R classic
|
||||
|
||||
tap:
|
||||
$(TAP) ./test/{unit,localization}/*.js --no-coverage -R classic
|
||||
|
||||
coverage:
|
||||
$(TAP) ./test/{unit,localization}/*.js --coverage --coverage-report=lcov
|
||||
|
||||
# ------------------------------------
|
||||
|
||||
.PHONY: build clean deploy translations webpack start test lint unit functional integration localization tap coverage
|
||||
.PHONY: deploy docker-up docker-down sync sync-fastly sync-s3
|
||||
|
|
12
package.json
12
package.json
|
@ -3,15 +3,15 @@
|
|||
"version": "1.0.0",
|
||||
"description": "Standalone WWW client for Scratch",
|
||||
"scripts": {
|
||||
"start": "make start",
|
||||
"stop": "make stop",
|
||||
"test": "make test",
|
||||
"start": "node ./dev-server/index.js",
|
||||
"test": "npm run test:lint && npm run build && npm run test:tap",
|
||||
"test:lint": "eslint --ext .js,.jsx,.json",
|
||||
"test:tap": "tap ./test/{unit-legacy,localization-legacy}/*.js --coverage --coverage-report=lcov",
|
||||
"build": "npm run clean && npm run translate && webpack --bail",
|
||||
"clean": "rm -rf ./build && rm -rf ./intl && mkdir -p build && mkdir -p intl",
|
||||
"smoke": "tap ./test/integration/smoke-testing/*.js --timeout=3600 --no-coverage -R classic",
|
||||
"smoke-verbose": "tap ./test/integration/smoke-testing/*.js --timeout=3600 --no-coverage -R spec",
|
||||
"smoke-sauce": "SMOKE_REMOTE=true tap ./test/integration/smoke-testing/*.js --timeout=60000 --no-coverage -R classic",
|
||||
"watch": "make watch",
|
||||
"build": "make build",
|
||||
"dev": "make watch && make start &",
|
||||
"translate:urls": "node ./bin/get-localized-urls localized-urls.json",
|
||||
"translate:files": "node ./bin/build-locales node_modules/scratch-l10n/www intl",
|
||||
"translate": "npm run translate:urls && npm run translate:files"
|
||||
|
|
Loading…
Add table
Reference in a new issue