public
public copied to clipboard
Rollup support
So far, wallaby looks awesome to me. Nice work! I use rollup to module bundler, but wallaby do not support yet.
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 is the wallaby API documented somewhere, or the only way is to look at the other open source plugins to understand the API ?
ok, found documentation https://wallabyjs.com/docs/config/postprocessor.html.
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 no i didn't.
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;
}
};
}
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 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 }
};
};

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