diff --git a/package.json b/package.json index 39fd209..d11db60 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "doc": "docs" }, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "./test.sh", "build": "./build.js" }, "repository": { diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..3f71a2f --- /dev/null +++ b/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +npm run build +output=$( git diff build ) + +if [ -z "$output" ] +then + break +else + echo "Build doesn't match, wanna run \`npm run build\`?" + exit 1; +fi