From 50c21ea94711952a981aa46aa619dfe9ce3fdb9c Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 28 Jan 2017 20:59:32 +1100 Subject: [PATCH] Replace sass-spec submodule with the npm package --- .gitmodules | 3 --- package.json | 3 ++- test/sass-spec | 1 - test/sass-spec.js | 14 +++++++++++--- 4 files changed, 13 insertions(+), 8 deletions(-) delete mode 100644 .gitmodules delete mode 160000 test/sass-spec diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6c8b1c0..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "test/sass-spec"] - path = test/sass-spec - url = https://github.com/sass/sass-spec.git diff --git a/package.json b/package.json index b7a046f..3299800 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A tokenzier for Sass' SCSS syntax", "main": "index.js", "scripts": { - "test": "git submodule update --init && node test/sass-spec.js" + "test": "node test/sass-spec.js" }, "repository": { "type": "git", @@ -30,6 +30,7 @@ }, "devDependencies": { "glob": "^5.0.10", + "sass-spec": "^3.5.0-1", "tripwire": "^0.10.0" } } diff --git a/test/sass-spec b/test/sass-spec deleted file mode 160000 index d1cbee4..0000000 --- a/test/sass-spec +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d1cbee4a79d6a3fbff3993f04c51f9662ca3a802 diff --git a/test/sass-spec.js b/test/sass-spec.js index bc576d2..fb9dcff 100644 --- a/test/sass-spec.js +++ b/test/sass-spec.js @@ -5,14 +5,16 @@ // ----------------------------------------------------------------------------- var fs = require('fs'); +var path = require('path'); var glob = require('glob'); var tripwire = require('tripwire'); +var spec = require('sass-spec'); var scss = require('../'); -var contents, file, i; var timeout = 3000; +var contents, file, errorFile, i; var fails = []; -var files = glob.sync('./test/sass-spec/spec/**/input.scss'); +var files = glob.sync(path.join(spec.dirname, 'spec/**/input.scss')); // ----------------------------------------------------------------------------- // We use tripwire to detect a long running process. If the process runs too @@ -35,6 +37,12 @@ tripwire.resetTripwire(timeout, {}); for(i = 0; i < files.length; i++) { file = files[i]; - var contents = fs.readFileSync(file, { encoding: 'utf8' }); + errorFile = path.join(path.dirname(file), 'error'); + + try { + if (fs.statSync(errorFile)) continue; + } catch (e) { } + + contents = fs.readFileSync(file, { encoding: 'utf8' }); scss.tokenize(contents); }