Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Gavri (Gabriel) Guy
    @gavriguy
    I tried to search for it but couldn’t get a clear answer - is there a way to rewire an es6 class instance method?
    speedskater
    @speedskater
    @RichardMarks do you have a sample for your problem?
    @gavriguy rewireing only instance methods is not possible. But you can rewire the class itself.
    @TheSavior a new version rc-3 is out there with your PR.
    @/all I will again have a look at some issues on the upcoming monday.
    Eli White
    @TheSavior
    @speedskater Thank you very much!
    Robert Stiff
    @uatec
    greetings
    speedskater
    @speedskater
    Hi. And sorry to everybody for the delays. I was quite busy due to a release at my company. I will be on hollidays for the upcoming two weeks and will try to work on issues and PR in the week starting at Monday June 27th.
    David Fox-Powell
    @dtothefp
    having issues with dynamic require in es6 file yelling that require is undefined
    //entry.js
    import thingToRewire from './thing'
    
    //thing.js
    export default thing () {
      require('./stuff')
    }
    speedskater
    @speedskater
    @dtothefp can you provide a sample project with your exact configuration?
    @/all published 1.0.0-rc-4
    Vincent Schramer
    @scvnc
    Sort of unrelated discussion: I really enjoy the testing patterns that rewire enables.. does anyone know about some strategies for applying it to TypeScript? Is there a way to use this with TypeScript or some typescript-plugin-rewire equivalent?
    Uladzimir Havenchyk
    @havenchyk
    Hi there! Is it possible to mock out the import from imported component?

    e.g.

    MyComponent.jsx has import someCoolFunctionThatShouldBeMocked

    Tom Rosier
    @tomrosier
    has anyone seen this error before Warning: [BABEL] src/file_parser.es6: Unknown option: foreign.visitor. Check out http://babeljs.io/docs/usage/options/ for more info Use --force to continue.
    Chris Braddock
    @chrisbraddock
    I need some help getting Rewire working. I think it may be at least being included as a plugin now, but I can't say for sure. I can tell it's doing something now because when I enable the plugin I see in my test output: PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR LOG: 'named exports are not supported in *.vue files.' however, I do not see any __RewireAPI__ being added to exports in my test files :(
    Chris Braddock
    @chrisbraddock
    ^ I've used vue-templates webpack as a starting point so isparta is involved
    Navid
    @navid_pandesh_twitter
    hi all, i found project and cant start it, i use nodemon --exec babel -- --stage 1 --optional strict -- index.js, but there are error "Error: Cannot find module '/home/wq/rozum2/1'" i think that the reason is in babel, what can be wrong?
    Navid
    @navid_pandesh_twitter
    --stage 1
    Marc
    @reposman33
    Can I use Babel-rewire-plugin when I run a Mocha test from IntelliJ?
    Roy Mor
    @Kashio

    How can I spy on a function that is references from an object? Example:
    a.js

    const map = {
     a,
     b,
     c
    };
    function run(options)  {
     map[options.val]();
    }
    function a() {...}
    function b() {...}
    function c() {...}

    a.spec.js

    import { a, __RewireAPI__ as ARewireAPI } from './a';
    
    describe('a', () => {
      describe('run', () => {
        const spy= jasmine.createSpy('spy').and.callFake(() => {
          ...
        });
        beforeEach(() => {
          ARewireAPI.__Rewire__('b', spy);
        });
        afterEach(() => {
          TooltipRewireAPI.__ResetDependency__('b');
        });
        it('calls b()', () => {
          a.run({val: 'b'}); // doesn't call the spy because what actually being called is the reference from the map object
        });
      });
    });
    Claire Martinez
    @Claire
    has anyone had any luck running the 1.x version of the require plugin with karma/jasmine on Phantomjs? its working on Chrome but not Phantomjs for me.
    I get errs like TypeError: 'undefined' is not a function (evaluating '_get__('AGGrid').__ResetDependency__('AgGridReact')') at :322
    Claire Martinez
    @Claire
    Oh I see it's already reported as an issue speedskater/babel-plugin-rewire#109 ; but it's not fixed yet.
    bradjohnwoods
    @bradjohnwoods
    hey guys, i’m trying to do a simple rewire and I get this error: TypeError: _photoImgFileHandler$2.default.Rewire is not a function
    is there another requirements other than installing babel-plugin-rewire through npm ?
    bradjohnwoods
    @bradjohnwoods
    ignore that, needed to add a plugins key to my babel.rc file
    Brandon Ramsey
    @brandonramsey
    I feel like I’m doing something wrong — When I put babel-plugin-rewire into place, all of my imports into my tested files start failing. I saw the ignoredIdentifiers config option — Am I supposed to ignore everything that is imported into all of my tested files? Some of my imports look like:
    import {Map} from ‘immutable’
    import {flatMap} from ‘lodash’
    etc...
    Bruno Teixeira
    @bmfteixeira_twitter
    hey guys?
    anyone there*
    ?
    John Wolfe
    @wolfejw86
    good morning, i have a question. is it possible to use ES6 promises without module bundling when using babel through gulp on my js files?
    WangYan
    @clownvary
    emmm, no one
    Boltmerz
    @Boltmerz
    Hello, Everyone, I want to ask is there a way to get the mocked function details like returned values and args in babel-plugin-rewire?
    Please see this link:
    https://stackoverflow.com/questions/55911777/babel-plugin-rewire-get-mock-call-count