wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
759 stars 45 forks source link

upgrade to angular 4 #1089

Closed oshri closed 7 years ago

oshri commented 7 years ago

Issue description or question

I Upgrade to angular4 and when i run wallaby: start i get this error.

​​Uncaught ReferenceError: Zone is not defined​​ ​​at http://localhost:51849/____wallaby-bundle.js?1490864235502&wallabyFileId=bundle:14520​​ ​​Specified entry pattern "src/wallabyTest.js" does not match any file.​​

Angular Cli version

@angular/cli: 1.0.0 node: 6.10.0 os: darwin x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.1

Wallaby.js configuration file

var wallabyWebpack = require('wallaby-webpack');

var webpackPostprocessor = wallabyWebpack({
  entryPatterns: [
    'src/wallabyTest.js',
    'src/**/*spec.js'
  ],

  module: {
    loaders: [
      {test: /\.css$/, loader: 'raw-loader'},
      {test: /\.html$/, loader: 'raw-loader'},
      {test: /\.js$/, loader: 'angular2-template-loader', exclude: /node_modules/},
      {test: /\.json$/, loader: 'json-loader'},
      {test: /\.styl$/, loaders: ['raw-loader', 'stylus-loader']},
      {test: /\.less$/, loaders: ['raw-loader', 'less-loader']},
      {test: /\.scss$|\.sass$/, loaders: ['raw-loader', 'sass-loader']},
      {test: /\.(jpg|png)$/, loader: 'url-loader?limit=128000'}
    ]
  }
});

var compilerOptions = require('./src/tsconfig.spec.json').compilerOptions;

module.exports = function (wallaby) {

  return {
    files: [
      {pattern: 'src/**/*.ts', load: false},
      {pattern: 'src/**/*.d.ts', ignore: true},
      {pattern: 'src/**/*.css', load: false},
      {pattern: 'src/**/*.less', load: false},
      {pattern: 'src/**/*.scss', load: false},
      {pattern: 'src/**/*.sass', load: false},
      {pattern: 'src/**/*.styl', load: false},
      {pattern: 'src/**/*.html', load: false},
      {pattern: 'src/**/*.json', load: false},
      {pattern: 'src/**/*spec.ts', ignore: true}
    ],

    tests: [
      {pattern: 'src/**/*spec.ts', load: false}
    ],

    testFramework: 'jasmine',

    compilers: {
      '**/*.ts': wallaby.compilers.typeScript(compilerOptions)
    },

    env: {
      kind: 'electron'
    },

    postprocessor: webpackPostprocessor,

    setup: function () {
      window.__moduleBundler.loadTests();
    },

    debug: true
  };
};

Code editor or IDE name and version

Visual Studio Code v1.x

OS name and version

OSX

oshri commented 7 years ago

I find the problem, in src/wallabyTest.js and it should by wallabyTest.ts :)

TheDevelolper commented 7 years ago

@oshri where? Could you provide the full code and highlight the part you're talking about?

ArtemGovorov commented 7 years ago

@KiransHub You may find the full example here: https://github.com/wallabyjs/ngCliWebpackSample/

Janatbek commented 5 years ago

@ArtemGovorov and @oshri are you guys talking about the file name or the reference to it in wallaby.js file?