public icon indicating copy to clipboard operation
public copied to clipboard

Rollup support

Open tamascsaba opened this issue 8 years ago • 9 comments

So far, wallaby looks awesome to me. Nice work! I use rollup to module bundler, but wallaby do not support yet.

tamascsaba avatar Aug 10 '16 06:08 tamascsaba

We don't yet have any particular plans to add the support for the bundler, but the good news is that wallaby does support other bundlers, like webpack and browserify, via open source plugins using wallaby API, so adding rollup support is possible for anyone who would like to implement it.

ArtemGovorov avatar Aug 10 '16 07:08 ArtemGovorov

@ArtemGovorov is the wallaby API documented somewhere, or the only way is to look at the other open source plugins to understand the API ?

git-jiby-me avatar May 20 '17 18:05 git-jiby-me

ok, found documentation https://wallabyjs.com/docs/config/postprocessor.html.

git-jiby-me avatar May 20 '17 18:05 git-jiby-me

I would really love support for rollup please. Recently, I found RE:DOM (https://redom.js.org/) and the used the recommended tool cli project generator (https://github.com/redom/redom-cli) The npm test works with putting the command in package.json . @git-jiby-me did you make any progress on the github/npm? I did try the wallaby.babel compiler but it does not work.

mocha --require babel-polyfill --compilers js:babel-register

whindes avatar Sep 14 '17 15:09 whindes

@whindes no i didn't.

git-jiby-me avatar Sep 15 '17 02:09 git-jiby-me

I did find a work around... maybe it is the configuration itself

https://github.com/wallabyjs/public/issues/469#issuecomment-186943317

The link above helped.

module.exports = function (wallaby) {
    return {
        debug: true,

        files: [
            'js/hello.js',
        ],

        tests: [
            'test/*.js'
        ],

        compilers: {
            '**/*.js?(x)': wallaby.compilers.babel()
        },

        env: {
            type: 'node'
        },

        testFramework: 'mocha',

        setup: function () {
            global.expect = require('chai').expect;
        }
    };
}

whindes avatar Sep 21 '17 22:09 whindes

I've got a project I'm working on that's using Rollup and Mocha. (https://github.com/polyforest/three-particles/) I can't seem to get wallaby to work, and I understand that it doesn't support rollup, but what I'm confused by is that my mocha tests themselves don't require rollup, I just run them via mocha.

My wallaby.conf.cjs:

module.exports = function(wallaby) {
  return {
    debug: true,
    files: [
      'package.json',
      'src/**.*.js',
    ],

    tests: [
      'test/**/*.js',
    ],

    env: {
      type: 'node',
    },

    testFramework: 'mocha'
  };
};

Cannot find module '.\src\easing.js' imported from .\test\easing.js 

Cannot find module '.\src\model.js' imported from .\test\model.js 

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'three' imported from .\test\particle-effect-loader.js 

What's strange about this message is that those paths aren't what's in my source. E.g. I have: import * as easing from '../src/easing.js';

nbilyk avatar Jan 29 '21 16:01 nbilyk

@nbilyk Your files src pattern has a typo (supposed to be src/**/*.js). After making the change (also adding test resources used in the tests and setting to reload workers), this config works for me in your repo:

module.exports = function(wallaby) {
  return {
    debug: true,
    files: [
      'package.json',
      'test-resources/**',
      'src/**/*.js',
    ],

    tests: [
      'test/**/*.js',
    ],

    env: {
      type: 'node',
    },

    testFramework: 'mocha',

    workers: { restart: true }
  };
};
Screen Shot 2021-01-30 at 11 25 09 am

ArtemGovorov avatar Jan 30 '21 01:01 ArtemGovorov

Ahh, super. Thank you, infant son means I've been missing the obvious :D. It's working for me now.

nbilyk avatar Jan 31 '21 05:01 nbilyk