Skip to content

Jest tests run against local code, not against the bundle  #4028

Closed
@aschrijver

Description

@aschrijver

Bug: Jest runs code from disk, ignores bundled code with shims

What is the current behavior?

I am using Ignite CLI, so I first filed this issue here: infinitered/ignite#1107
See here for additional details.

The problem is that Jest seems to be running tests against the files on my local disk, rather than those that were packaged in the output bundle.
I noticed this because I have shims that should cause unit tests to fail (I have node-based dependencies that I want to mould into my RN project), but they are succeeding.
The deployed app in the emulator is giving the expected errors.

What is the expected behavior?

The tests should fail, so I can debug and figure out which shims I have to tweak to get the node packages running in RN.

Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.

System
  platform           linux                                                                                                
  arch               x64                                                                                                  
  cpu                4 cores                  Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz  

JavaScript
  node               7.10.1       /usr/local/bin/node  
  npm                4.2.0        /usr/local/bin/npm   
  yarn               0.24.6       /usr/bin/yarn        

React Native
  react-native-cli   2.0.1       
  app rn version     0.45.1      

Ignite
  ignite             2.0.0        /usr/local/bin/ignite  

Android
  java               1.8.0_111    /usr/bin/java  
  android home       -            undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions