New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallaby.js for ReactNative #2230
Comments
Can you please share how you created your react native app, or else provide us with a sample repo? We created a new react app using |
Thanks for your response. This project wasn't created using Jest from package.json:
Wallaby console:
I'll investigate further but unfortunately cannot provide this repo. Let me know if you need any versions from |
Please use this repo to reproduce the issue: |
Looks like I may not be able to upgrade jest because of this issue: |
Thanks for providing the sample repo. We saw that your sample repo already works with Automatic Configuration if the ShallowWrapper issue you referenced above is not a problem. It looks like you used our Wallaby configuration file for create-react-app as the base for your configuration file. Create-react-app is a little different because create-react-app tests are run using the We have provided a working Wallaby.js configuration file (see below) that will work if you don't want to use Automatic Configuration. The changes to the configuration you already had in your sample repo were:
module.exports = function(wallaby) {
var path = require('path');
process.env.NODE_PATH += path.delimiter + path.join(__dirname, 'node_modules');
require('module').Module._initPaths();
return {
files: ['jest/setup.js', 'App.js', '!__tests__/**/*'],
tests: ['src/**/*.test.js?(x)', '__tests__/**/*.js', '__tests__/*.js'],
env: {
type: 'node'
},
compilers: {
'**/*.js?(x)': wallaby.compilers.babel()
},
setup: wallaby => {
const jestConfig = require('./package.json').jest;
Object.keys(jestConfig.transform || {}).forEach(
k => ~k.indexOf('^.+\\.(js|jsx') && void delete jestConfig.transform[k]
);
delete jestConfig.testEnvironment;
wallaby.testFramework.configure(jestConfig);
},
testFramework: 'jest'
};
}; |
Note for all: Make sure you add your src folder to wallaby.js files: |
Running into an issue from wallaby. Current workaround is to change folder name in package.json.
|
You need to add the missing file to the wallaby config files: [
'jest/setup.js',
+ 'jest/preprocessor.js',
'App.js',
'!__tests__/**/*',
'./src/**/*'
], |
So this is working great except react components (anything that extends |
Could you please create or update your previous repo with a sample so we can duplicate the problem? |
So, quickly I am seeing below in the wallaby console:
This is likely coming from If you have any ideas, let me know, I will try to investigate further. Thank you. |
It sounds like your issue has something to do with react-native. Unfortunately we're not especially familiar with react-native. Could you please create or update your previous repo with a sample so we can duplicate the problem and see what's going on? |
Closing this issue due to lack of activity. If you can provide us with a sample repo, we'll re-open the issue and investigate for you. |
Few more notes for the community:
|
I cannot get wallaby working with ReactNative. Automatic configuration doesn't work neither manual from https://wallabyjs.com/docs/integration/react-jsx.html. I tried various other combinations that fail into errors from VS Code. Is there an official React Native working copy for Wallaby.js
Please use this repo to reproduce the issue:
https://github.com/manish-jain-1/wallabytest.git
Here's part of package.json info:
babel.config.js
Errors with wallaby.js from the page: https://wallabyjs.com/docs/integration/react-jsx.html
I also tried solution from #1798 that didn't work.
The text was updated successfully, but these errors were encountered: