nippur72 / ifdef-loader

Webpack loader for JavaScript/TypeScript conditional compilation.
286 stars 28 forks source link

Fix failing tests because of es6 and line endings #26

Closed adrianlee closed 5 years ago

adrianlee commented 5 years ago

npm run test is failing. These changes will fix that.

> ifdef-loader@2.1.2 test D:\repros\ifdef-loader
> node node_modules/webpack/bin/webpack.js & tsc & jasmine --no-color

#if block lines [1-3]: Condition 'DEBUG' is TRUE. Including lines [1-3].
#if block lines [5-7]: Condition 'version < 2' is FALSE. Excluding everything.
#if block lines [9-11]: Condition '!DEBUG' is FALSE. Excluding everything.
#if block lines [13-15]: Condition 'version > 2' is TRUE. Including lines [13-15].
Hash: 28199635a1c8d270aa03
Version: webpack 3.12.0
Time: 95ms
                Asset     Size  Chunks             Chunk Names
webpack.out.actual.js  2.89 kB       0  [emitted]  main
   [0] ./spec/data/webpack.in.js 47 bytes {0} [built]
   [1] ./spec/data/webpack.in.module.js 244 bytes {0} [built]
node_modules/@types/webpack/index.d.ts(762,34): error TS2304: Cannot find name 'Set'.
node_modules/@types/webpack/index.d.ts(968,26): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(971,31): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(972,26): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(974,23): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(984,34): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(985,34): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(989,29): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(990,32): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(1097,38): error TS2304: Cannot find name 'Set'.
node_modules/@types/webpack/index.d.ts(1117,25): error TS2304: Cannot find name 'Map'.
node_modules/@types/webpack/index.d.ts(1118,28): error TS2304: Cannot find name 'Map'.
Started
................F

Failures:
1) webpack bundle build correctly on spec/data/webpack.in.js
  Message:
    Expected '(function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap
    /******/    // The module cache
    /******/    var installedModules = {};
    /******/
    /******/    // The require function
    /******/    function __webpack_require__(moduleId) {
    /******/
    /******/        // Check if module is in cache
    /******/        if(installedModules[moduleId]) {
    /******/            return installedModules[moduleId].exports;
    /******/        }
    /******/        // Create a new module (and put it into the cache)
    /******/        var module = installedModules[moduleId] = {
    /******/            i: moduleId,
    /******/            l: false,
    /******/            exports: {}
    /******/        };
    /******/
    /******/        // Execute the module function
    /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    /******/
    /******/        // Flag the module as loaded
    /******/        module.l = true;
    /******/
    /******/        // Return the exports of the module
    /******/        return module.exports;
    /******/    }
    /******/
    /******/
    /******/    // expose  ... to equal '(function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap
    /******/    // The module cache
    /******/    var installedModules = {};
    /******/
    /******/    // The require function
    /******/    function __webpack_require__(moduleId) {
    /******/
    /******/        // Check if module is in cache
    /******/        if(installedModules[moduleId]) {
    /******/            return installedModules[moduleId].exports;
    /******/        }
    /******/        // Create a new module (and put it into the cache)
    /******/        var module = installedModules[moduleId] = {
    /******/            i: moduleId,
    /******/            l: false,
    /******/            exports: {}
    /******/        };
    /******/
    /******/        // Execute the module function
    /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    /******/
    /******/        // Flag the module as loaded
    /******/        module.l = true;
    /******/
    /******/        // Return the exports of the module
    /******/        return module.exports;
    /******/    }
    /******/
    / ....
  Stack:
    Error: Expected '(function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap
    /******/    // The module cache
    /******/    var installedModules = {};
    /******/
    /******/    // The require function
    /******/    function __webpack_require__(moduleId) {
    /******/
    /******/        // Check if module is in cache
    /******/        if(installedModules[moduleId]) {
    /******/            return installedModules[moduleId].exports;
    /******/        }
    /******/        // Create a new module (and put it into the cache)
    /******/        var module = installedModules[moduleId] = {
    /******/            i: moduleId,
    /******/            l: false,
    /******/            exports: {}
    /******/        };
    /******/
    /******/        // Execute the module function
    /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    /******/
    /******/        // Flag the module as loaded
    /******/        module.l = true;
    /******/
    /******/        // Return the exports of the module
    /******/        return module.exports;
    /******/    }
    /******/
    /******/
    /******/    // expose  ... to equal '(function(e, a) { for(var i in a) e[i] = a[i]; }(this, /******/ (function(modules) { // webpackBootstrap
    /******/    // The module cache
    /******/    var installedModules = {};
    /******/
    /******/    // The require function
    /******/    function __webpack_require__(moduleId) {
    /******/
    /******/        // Check if module is in cache
    /******/        if(installedModules[moduleId]) {
    /******/            return installedModules[moduleId].exports;
    /******/        }
    /******/        // Create a new module (and put it into the cache)
    /******/        var module = installedModules[moduleId] = {
    /******/            i: moduleId,
    /******/            l: false,
    /******/            exports: {}
    /******/        };
    /******/
    /******/        // Execute the module function
    /******/        modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    /******/
    /******/        // Flag the module as loaded
    /******/        module.l = true;
    /******/
    /******/        // Return the exports of the module
    /******/        return module.exports;
    /******/    }
    /******/
    / ....
        at UserContext.<anonymous> (D:\repros\ifdef-loader\spec\processSpec.js:64:32)

17 specs, 1 failure
Finished in 0.055 seconds
adrianlee commented 5 years ago

Verified tests pass on Windows and Mac.