Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
node_modules
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
# Webstorm
.idea

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Michael Pratt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,50 @@
Case Sensitive Paths - Webpack Plugin
==========
This Webpack plugin enforces the entire path of all required modules match the exact case of the actual path on disk.
Using this plugin helps alleviate cases where developers working on OSX, which does not follow strict path case sensitivity,
will cause conflicts with other developers or build boxes running other operating systems which require correctly cased paths.
[Previous](https://gist.github.com/Morhaus/333579c2a5b4db644bd50) [iterations](https://github.com/dcousineau/force-case-sensitivity-webpack-plugin) on this same idea provide the basis for this plugin, but unfortunately do not properly check case on
the entire path. This plugin fixes that. Example output:
> ERROR in ./src/containers/SearchProducts.js
Module not found: Error: [CaseSensitivePathsPlugin] `/Users/example/yourproject/src/components/searchProducts/searchproducts.js` does not match the corresponding path on disk `/Users/example/yourproject/src/components/searchproducts`
@ ./src/containers/SearchProducts.js 9:22-84
Install
----
npm install --save-dev case-sensitive-paths-webpack-plugin
Usage
----
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
var webpackConfig = {
plugins: [
new CaseSensitivePathsPlugin()
// other plugins ...
]
// other webpack config ...
}
Want more information? Pass ```{debug: true}``` to the plugin like so:
new CaseSensitivePathsPlugin({debug: true})
It will output every directory it reads, as well as a sum total of filesystem operations.
This is mostly useful for internal debugging of the plugin, but if you find it useful, more power to you.
Demo
---
Check the `/demo` directory for a working example of the plugin in action, with tests demonstrating the effect of the plugin. See `/demo/README.md` for more.
Thanks & Credit
----
* [Daniel Cousineau](https://github.com/dcousineau) who wrote an [earlier version](https://github.com/dcousineau/force-case-sensitivity-webpack-plugin) of this case-sensitivity plugin
* [Alexandre Kirszenberg](https://github.com/Morhaus) who's [gist](https://gist.github.com/Morhaus/333579c2a5b4db644bd5) formed the basis of both these plugins.
* [Cameron Brewer](https://github.com/morethanfire) and [Ben Collins](https://github.com/aggieben) who added Windows support.
* [Christian Lilley](https://github.com/xml) who added a demo/test package.
* [Lance Eastgate](https://github.com/NorwegianKiwi) who added some internationalization support
* [Jonathan Kim](https://github.com/jkimbo) and [Dan Abramov](https://github.com/gaearon) who investigated, fixed, and added some tests for a crashing bug.

View File

@@ -0,0 +1,4 @@
{
plugins: ['transform-runtime', 'transform-decorators-legacy'],
presets: ['es2015', 'stage-0', 'react']
}

View File

@@ -0,0 +1,40 @@
# temp files
.DS_Store
.tmp
.sass-cache
# package-management
node_modules/
.bin/
bower_components/
npm-debug.log
# build folder
dist/
# IDE
*.sublime-project
*.sublime-workspace
.idea/
# Thumbnails
# ._*
### OSX ###
.AppleDouble
.LSOverride
Icon
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/

View File

@@ -0,0 +1,24 @@
# Just a Demo
### Purpose
This demo provides a working example of the Case Sensitive Paths - Webpack Plugin in action. The demo source is just a basic React app compiled with Webpack. The unit-tests show that attempting to `import` modules that are spelled correctly - but with incorrect cases in the filename or path - will result in a Webpack build error.
### Use
To run the demo project:
* clone the full plugin repo
* `cd /demo`
* `npm install`
* `npm start`
To run the demo tests:
* (everything above)
* `npm test`
You should see 3 passed tests and 2 errors: `Module not found: Error: CaseSensitivePathsPlugin:`. In those examples, we've deliberately misspelled the cases of a module name or path, and the plugin has caused Webpack to throw an error during build.
Note the following:
* If you want to test the plugin like this in your own project, and you have a separate webpack config for testing (this one is in karma.conf.js), you'll need to also include the plugin there.
* This demo is based on patterns borrowed from a host of React/Webpack seed projects, but it's impossible to say which parts from where. Many thanks to the robust React community for providing such excellent tooling!

View File

@@ -0,0 +1,38 @@
// karma.conf.js
const webpack = require('webpack');
const wpc = require('./webpack.config');
const CaseSensitivePathsPlugin = require('../index.js'); // use inside the npm package
module.exports = function(config) {
config.set({
browsers: ['PhantomJS', 'Chrome'],
singleRun: true,
frameworks: ['jasmine'],
files: [
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
'tests.webpack.js'
],
preprocessors: {
'tests.webpack.js': ['webpack', 'sourcemap']
},
webpack: {
devtool: 'inline-sourcemap',
resolve: wpc.resolve, // get from main webpack config
module: {
loaders: wpc.module.loaders, // get from main webpack config
},
watch: true,
plugins: [
new webpack.DefinePlugin({
__ENV__: JSON.stringify('dev') // always test in 'dev' environment
}),
// Mac doesn't care about case, but linux servers do, so enforce...
new CaseSensitivePathsPlugin()
],
},
webpackServer: {
noInfo: true
}
});
};

View File

@@ -0,0 +1,55 @@
{
"name": "casesensitivepathswebpackpluginDemo",
"version": "0.0.1",
"engines": {
"node": "^4 || ^5"
},
"engine-strict": true,
"description": "just a simple demo for showing config and how to E2E test",
"main": "app.js",
"src": "src",
"test": "test",
"dist": "dist",
"mainInput": "main",
"mainOutput": "main",
"scripts": {
"start": "NODE_ENV=dev node ./servers/server.js",
"test": "./node_modules/.bin/karma start --single-run --browsers PhantomJS --reporters dots",
"build": "./node_modules/.bin/webpack --config ./webpack.config.js --progress --colors -p"
},
"author": "Urthen & XML",
"license": "MIT",
"dependencies": {
"babel-polyfill": "^6.7.4",
"babel-runtime": "^6.6.1",
"react": "^15.0.0",
"react-dom": "^15.0.0"
},
"devDependencies": {
"babel-core": "^6.0.0",
"babel-eslint": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-runtime": "^6.6.0",
"babel-preset-es2015": "^6.0.0",
"babel-preset-react": "^6.0.0",
"babel-preset-stage-0": "^6.0.0",
"html-webpack-plugin": "^1.6.1",
"jasmine": "^2.3.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.9",
"karma-chrome-launcher": "^0.2.0",
"karma-cli": "^0.1.0",
"karma-coverage": "^0.5.2",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^0.2.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"phantomjs": "^1.9.19",
"phantomjs-polyfill": "0.0.2",
"react-addons-test-utils": "^0.14.8",
"react-hot-loader": "^1.3.0",
"webpack": "~1.12.0",
"webpack-dev-server": "~1.14.1"
}
}

View File

@@ -0,0 +1,20 @@
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../webpack.config');
const host = '0.0.0.0'; // allows connection from external devices
const portNum = 3000;
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
contentBase: 'src/',
stats: { colors: true }
}).listen(portNum, host, function (err, result) {
if (err) {
return console.log(err);
}
console.log('Listening at http://' + host + ':' + portNum + '/');
});

View File

@@ -0,0 +1,21 @@
import React, { Component } from 'react';
export default class AppRoot extends Component {
// we can't use `connect` in this component, so must do naiively:
constructor(props) {
super(props);
this.state = {
};
}
render() {
return (
<div>
<h1>This is just an empty demo</h1>
<p>(Run the tests.)</p>
</div>
);
}
}

View File

@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="react-app-hook">
</div>
<!-- main.js is produced by Webpack -->
<script type="text/javascript" src="/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
import AppRoot from './AppRoot.component.js';
import React from 'react';
import ReactDOM from 'react-dom';
const app = {
initialize() {
ReactDOM.render(<AppRoot/>, document.getElementById('react-app-hook'));
}
};
app.initialize();

View File

@@ -0,0 +1,3 @@
export default function() {
console.log('Hello, universe.');
};

View File

@@ -0,0 +1,15 @@
describe("Case-Sensitive Paths Plugin", () => {
it('shouldn\'t interfere with correctly-spelled imports', () => {
const getUser1 = require('../src/utils/api');
expect(getUser1).toBeDefined();
});
it('should cause mistakes in filename case to fail import', () => {
expect(() => {const getUser2 = require('../src/utils/API');}).toThrow();
});
it('should cause mistakes in path case to fail import', () => {
expect(() => {const getUser3 = require('../src/Utils/api');}).toThrow();
});
});

View File

@@ -0,0 +1,3 @@
// tests.webpack.js
var context = require.context('./test', true, /-test\.(js|jsx)$/);
context.keys().forEach(context);

View File

@@ -0,0 +1,85 @@
var webpack = require('webpack');
var path = require('path');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var CaseSensitivePathsPlugin = require('../index.js'); // use inside the npm package
// We use the NODE_ENV in our automation commands to differentiate environments
var production =
process.env.NODE_ENV === 'production' ||
process.env.NODE_ENV === 'preprod';
// Setup our plugins.
var plugins = [
// attaches the webpack-generated JS to our main HTML file
new HtmlWebpackPlugin({template: './src/index.html'}),
// create global access to the NODE_ENV within our Webpacked code:
new webpack.DefinePlugin({
__ENV__: JSON.stringify(process.env.NODE_ENV)
}),
// http://gaearon.github.io/react-hot-loader/getstarted/
new webpack.HotModuleReplacementPlugin(),
// Mac doesn't care about case, but linux servers do, so enforce...
new CaseSensitivePathsPlugin()
];
// In production we do a bit more...
if (production) {
plugins.concat(
[
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]);
}
const devEntry = [
'webpack-dev-server/client?http://0.0.0.0:3000', // tells client where to get hot reloads
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
'babel-polyfill', // for full ES6 compatibility on older devices
'./src/init.js'
];
const prodEntry = [
'babel-polyfill', // for full ES6 compatibility on older devices
'./src/init.js'
];
const theEntry = (production) ? prodEntry : devEntry;
module.exports = {
// Bundle to our dist folder as a main.js file.
output: {
path: path.join(__dirname, 'dist'),
filename: 'main.js',
publicPath: '/'
},
devtool: 'sourcemap',
// Our master entry point.
entry: theEntry,
// Extra helpers to make require or include easier.
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
module: {
loaders: [{
test: /\.(js|jsx)$/,
// in dev only, hotload
loader: production ? 'babel' : 'react-hot!babel',
// other babel options are specified in .babelrc
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json'
}]
},
plugins: plugins
};

View File

@@ -0,0 +1,136 @@
/* This plugin based on https://gist.github.com/Morhaus/333579c2a5b4db644bd5
Original license:
--------
The MIT License (MIT)
Copyright (c) 2015 Alexandre Kirszenberg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------
And it's NPM-ified version: https://github.com/dcousineau/force-case-sensitivity-webpack-plugin
Author Daniel Cousineau indicated MIT license as well but did not include it
The originals did not properly case-sensitize the entire path, however. This plugin resolves that issue.
This plugin license, also MIT:
--------
The MIT License (MIT)
Copyright (c) 2016 Michael Pratt
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------
*/
var path = require('path');
var fs = require('fs');
function CaseSensitivePathsPlugin(options) {
this.options = options || {};
this.reset();
}
CaseSensitivePathsPlugin.prototype.reset = function () {
// Keep cache of filesystem contents along path reduce FS operations
this.pathCache = {};
this.fsOperations = 0;
// Prime the cache with the current directory. We have to assume the current casing is correct,
// as in certain circumstances people can switch into an incorrectly-cased directory.
var currentPath = path.resolve();
this.pathCache[currentPath] = this.getFilenamesInDir(currentPath);
}
CaseSensitivePathsPlugin.prototype.getFilenamesInDir = function (dir) {
if (this.pathCache.hasOwnProperty(dir)) {
return this.pathCache[dir];
} else {
this.fsOperations += 1;
if (this.options.debug) {
console.log('[CaseSensitivePathsPlugin] Reading directory', dir);
}
try {
return fs.readdirSync(dir).map(function(f) { return f.normalize ? f.normalize('NFC') : f; });
} catch (err) {
if (this.options.debug) {
console.log('[CaseSensitivePathsPlugin] Failed to read directory', dir, err);
}
return [];
}
}
};
// This function based on code found at http://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive
// By Patrick McElhaney (No license indicated - Stack Overflow Answer)
// This version will return with the real name of any incorrectly-cased portion of the path, null otherwise.
CaseSensitivePathsPlugin.prototype.fileExistsWithCaseSync = function (filepath) {
// Split filepath into current filename (or directory name) and parent directory tree.
var dir = path.dirname(filepath);
var filename = path.basename(filepath);
var parsedPath = path.parse(dir);
// If we are at the root, or have found a path we already know is good, return.
if (parsedPath.dir === parsedPath.root || dir === '.' || this.pathCache.hasOwnProperty(filepath)) return;
// Check all filenames in the current dir against current filename to ensure one of them matches.
// Read from the cache if available, from FS if not.
var filenames = this.getFilenamesInDir(dir);
// If the exact match does not exist, attempt to find the correct filename.
if (filenames.indexOf(filename) === - 1) {
// Fallback value, just in case.
var correctFilename = '- File does not exist.';
for (var i = 0; i < filenames.length; i++) {
if (filenames[i].toLowerCase() === filename.toLowerCase()) {
correctFilename = '`' + filenames[i] + '`.';
break;
}
}
return correctFilename;
}
// If exact match exists, recurse through directory tree until root.
var recurse = this.fileExistsWithCaseSync(dir);
// If found an error elsewhere, return that correct filename
// Don't bother caching - we're about to error out anyway.
if (recurse) {
return recurse;
}
// If no error elsewhere, this is known good - store in the cache.
this.pathCache[dir] = filenames;
}
CaseSensitivePathsPlugin.prototype.apply = function(compiler) {
var _this = this;
compiler.plugin('done', function() {
if (_this.options.debug) {
console.log('[CaseSensitivePathsPlugin] Total filesystem reads:', _this.fsOperations);
}
_this.reset();
});
compiler.plugin('normal-module-factory', function(nmf) {
nmf.plugin('after-resolve', function(data, done) {
// Trim ? off, since some loaders add that to the resource they're attemping to load
var pathName = data.resource.split('?')[0];
pathName = pathName.normalize ? pathName.normalize('NFC') : pathName;
var realName = _this.fileExistsWithCaseSync(pathName);
if (realName) {
done(new Error('[CaseSensitivePathsPlugin] `' + pathName + '` does not match the corresponding path on disk ' + realName));
} else {
done(null, data);
}
});
});
};
module.exports = CaseSensitivePathsPlugin;

View File

@@ -0,0 +1,57 @@
{
"_from": "case-sensitive-paths-webpack-plugin@1.1.4",
"_id": "case-sensitive-paths-webpack-plugin@1.1.4",
"_inBundle": false,
"_integrity": "sha1-iq7dVpmobKwrNM9A2bQUV1iXhHI=",
"_location": "/case-sensitive-paths-webpack-plugin",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "case-sensitive-paths-webpack-plugin@1.1.4",
"name": "case-sensitive-paths-webpack-plugin",
"escapedName": "case-sensitive-paths-webpack-plugin",
"rawSpec": "1.1.4",
"saveSpec": null,
"fetchSpec": "1.1.4"
},
"_requiredBy": [
"/react-scripts"
],
"_resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-1.1.4.tgz",
"_shasum": "8aaedd5699a86cac2b34cf40d9b4145758978472",
"_spec": "case-sensitive-paths-webpack-plugin@1.1.4",
"_where": "/home/bilal/Saburly/slucajna-televizija/node_modules/react-scripts",
"author": {
"name": "Michael Pratt"
},
"bugs": {
"url": "https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Enforces module path case sensitivity in Webpack",
"devDependencies": {
"mocha": "^3.0.1",
"webpack": "^1.13.1"
},
"homepage": "https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme",
"keywords": [
"webpack",
"plugin",
"case sensitive",
"import",
"require"
],
"license": "MIT",
"main": "index.js",
"name": "case-sensitive-paths-webpack-plugin",
"repository": {
"type": "git",
"url": "git+https://github.com/Urthen/case-sensitive-paths-webpack-plugin.git"
},
"scripts": {
"test": "mocha test/"
},
"version": "1.1.4"
}

View File

@@ -0,0 +1 @@
js/

View File

@@ -0,0 +1 @@
var testModule = require('./test-folder/testfile');

View File

@@ -0,0 +1 @@
var testModule = require('./TestFile');

View File

@@ -0,0 +1 @@
module.exports = '';

View File

@@ -0,0 +1,90 @@
var assert = require("assert");
var fs = require("fs");
var path = require("path");
var exec = require('child_process').exec;
var webpack = require("webpack");
var CaseSensitivePathsPlugin = require("../");
describe("CaseSensitivePathsPlugin", function() {
it("should compile and warn on wrong filename case", function(done) {
webpack({
context: path.join(__dirname, "fixtures", "wrong-case"),
target: "node",
output: {
path: path.join(__dirname, "js"),
filename: "result.js",
},
entry: "./entry",
plugins: [
new CaseSensitivePathsPlugin()
]
}, function(err, stats) {
if (err) done(err);
assert(stats.hasErrors());
assert.equal(stats.hasWarnings(), false);
var jsonStats = stats.toJson();
assert.equal(jsonStats.errors.length, 1);
var error = jsonStats.errors[0].split("\n");
// check that the plugin produces the correct output
assert(error[1].indexOf('[CaseSensitivePathsPlugin]') > -1);
assert(error[1].indexOf('TestFile.js') > -1); // wrong file require
assert(error[1].indexOf('testfile.js') > -1); // actual file name
done();
});
});
it("should handle the deletion of a folder", function(done) {
var compiler = webpack({
context: path.join(__dirname, "fixtures", "deleting-folder"),
target: "node",
output: {
path: path.join(__dirname, "js"),
filename: "result.js",
},
entry: "./entry",
plugins: [
new CaseSensitivePathsPlugin()
]
});
// create folder and file to be deleted
var testFolder = path.join(__dirname, "fixtures", "deleting-folder", "test-folder");
fs.mkdirSync(testFolder);
fs.writeFileSync(path.join(testFolder, "testfile.js"), "module.exports = '';");
var watchCount = 0;
var watcher = compiler.watch({ poll: true }, function(err, stats) {
if (err) done(err);
watchCount++;
if (watchCount === 1) {
assert.equal(stats.hasErrors(), false);
assert.equal(stats.hasWarnings(), false);
// wait for things to settle
setTimeout(function() {
// after initial compile delete test folder
exec("rm -r " + testFolder, function(err) { if (err) done(err); });
}, 100);
return;
}
if (watchCount === 2) {
assert(stats.hasErrors());
assert.equal(stats.hasWarnings(), false);
var jsonStats = stats.toJson();
assert.equal(jsonStats.errors.length, 1);
watcher.close(done);
return;
}
throw Error("Shouldn't be here...");
});
});
});