by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kimmo Sääskilahti
    @ksaaskil
    A module bundler like webpack or metro would anyway only include the used dependencies in the final bundle (if unmock was bundled into the app for development or other reason).
    Mike Solomon
    @mikesol
    @ksaaskil I think that's fine, as ultimately it does not inflate the binary size, just the build environment size, and as we are working with a monorepo anyway, there is no chance that the packages will get out of sync.
    I am creating stub projects for swift (github.com/unmock/swift) and C# (github.com/unmock/c-sharp).
    Kimmo Sääskilahti
    @ksaaskil

    Made a sketch for unmock-fetch, a package that would define a fetch interceptor by overriding global.fetch or window.fetch and, for Unmock's use, would also export fetch that would work like fetch but use Unmock behind the scenes. unmock/unmock-js#312

    I think the package could be generally useful in the same way as node-mitm, so probably the "unmock algorithm" should not be part of the package.

    If we go with a package structure like this, I would see additional packages like unmock-react-native that implements "Backend" with unmock-fetch as interceptor and unmock-node doing the same thing with node-mitm. Also possiblyunmock-types would be needed if unmock-fetch did not depend on the "core".

    I did not yet think about monkey patching XMLHttpRequest, is someone still using that? I also understood that fetch API is independent of XMLHttpRequest in modern environments so that fetch cannot be patched by patching XMLHttpRequest.

    But I could be wrong there, I don't really know that stuff that well.
    Kimmo Sääskilahti
    @ksaaskil
    I still don't have that clear picture how easy it is to make unmock-core fully isomorphic, for example openapi-refinements does not seem to run outside of Node.js so it could take some time to fix everything.
    Kimmo Sääskilahti
    @ksaaskil
    Yeah that's definitely then missed with just patching fetch so one would also need to patch XMLHttpRequest. But isomorphic fetch packages like "cross-fetch" and "isomorphic-fetch" are very popular as well so we'd cover a lot of ground already by patching fetch. But yep, I can see us then also releasing unmock-xml-http-request that provides a simple API to intercept and mock XMLHttpRequest. And for example unmock-browser would then wrap both fetch and XMLHttpRequest interceptors as one interceptor.
    Kimmo Sääskilahti
    @ksaaskil
    Small heads-up: I'm doing a big refactoring extracting unmock-node from unmock-core unmock/unmock-js#313
    Mike Solomon
    @mikesol
    @ksaaskil :+1:
    Also, we probably want to ditch node-fetch from a dependency in unmock-core (https://github.com/unmock/unmock-js/blob/dev/packages/unmock-core/src/index.ts). I had originally created unmock-fetch in case we eventually wanted to link testing to production traffic, but no one seems to dig the idea, so it's probably best to just get rid of it. That means that we'll have to update our examples to use node-fetch instead of unmock.fetch, but the API is the same.
    Kimmo Sääskilahti
    @ksaaskil
    The PR keeps it as part of unmock-node but it can be removed later on.
    Mike Solomon
    @mikesol
    I've found https://github.com/ueg1990/faker-schema for python faking, but is there something closer to json-schema-faker?
    Kimmo Sääskilahti
    @ksaaskil
    Not that I know if, please write one in C :)
    Mike Solomon
    @mikesol
    @ksaaskil you mentioned the idea of having some type of core unmock package. I can see this playing out on two levels:
    • a core library of functions in C or C++ that can bind to other languages
    • a server to which requests are rerouted. this would be not unlike the old days of unmock, with the exception that the server is local instead of remote.
    Mike Solomon
    @mikesol
    I wonder how fast you could start or stop a server - one idea would be to have an ephemeral server that spins up and self destructs for every request on a different port. Then you are only bound by the number of available ports in case of concurrency...
    Bukhaar M
    @bukharim96
    Hi all. I'd like feedback on #303. BTW, this might fit in with the idea of a core unmock lib.
    Mike Solomon
    @mikesol
    @carolstran a couple random thoughts about telemetry...
    1. It seems like public storage is an attractive option, as otherwise no one will trust who is getting the data or how it is being used.
    1. There is probably room in the world for a js telemetry library for open source projects that enforces a set of best practices for data collection via a community.
    Oops, that was supposed to be 2 :-)
    Maybe unmock/open-telemetry
    Mike Solomon
    @mikesol
    Another challenge is data authenticity - because there is no way we can embed a token in an OS project, whatever the API would be would be completely open for people to basically send whatever they want.
    Kimmo Sääskilahti
    @ksaaskil
    I wouldn't maybe worry about authenticity that much, the world is full of public GA tracking IDs that probably aren't configured in anyway to handle the unlikely case someone starts misusing it. But of course nice if that can be handled.
    I think as a first step, it might be reasonable to only track the downloads like Pact does so we know where the library is used and which versions https://github.com/pact-foundation/pact-node/blob/master/standalone/install.ts#L152
    The next step (if we decide to go there) might be to start tracking anonymous events (without including any properties), not unlike optic does.
    Carolyn
    @carolstran

    Added all of your notes about telemetry to the initial doc, thanks!

    Also @ksaaskil question for you re: some of our tests. I'm running with this idea of adding more meaningful placeholders and stumbled across this test in the unmock-node package: https://github.com/unmock/unmock-js/blob/dev/packages/unmock-node/src/__tests__/index.test.ts#L38-L44

    What is this testing for exactly? I'm trying to think of a better replacement for "foo" (maybe var, data, whatever) but also curious about whether or not we actually need this test.

    Kimmo Sääskilahti
    @ksaaskil
    It's just a sanity check that sinon is exported and functional, just to make sure anyone doesn't accidentally delete the sinon export.
    Kimmo Sääskilahti
    @ksaaskil
    Ok to merge this? unmock/unmock-js#314
    Mike Solomon
    @mikesol
    @ksaaskil yup!
    Carolyn
    @carolstran
    We have a linter (for insensitive, offensive and condescending terms) on our docs now :tada:
    Well ok it's not actively linting the docs yet - still need to fix the issues, but that's in progress!
    Thanks for the note about the CircleCI config @ksaaskil, I'll look into that today
    Kimmo Sääskilahti
    @ksaaskil
    I'll create a new release branch, lots of stuff has been added since the previous release.
    Kimmo Sääskilahti
    @ksaaskil
    Updated our React Native example to display random cat facts 🐈 https://github.com/unmock/unmock-react-native-example
    abe312
    @abe312
    Do you guys have any frontend/MERN/React opportunities? Here's a drum machine I created in react, redux and css-grid: https://abe312-drum-machine.glitch.me/
    Kimmo Sääskilahti
    @ksaaskil
    @abe312 That's great, maybe send your cv and a brief story about yourself to jobs@meeshkan.com and we'll see!
    Mike Solomon
    @mikesol
    I just had a chance to check out the unmock-server branch - it is pretty cool stuff! If the project develops further, I wonder if/when a libunmock will be in order? It makes sense to start with NodeJS as that is our most developed library, but at a certain point, having the whole stack in TypeScript seems like a disadvantage if the goal is to deploy it as a stand-alone or embedded entity. I'm wondering how we could test that out 🤔
    Kimmo Sääskilahti
    @ksaaskil
    Hmm, I wonder if the the easiest first step would be to ship it as a Docker image, that might cover a bunch of cases already.
    Bukhaar M
    @bukharim96
    @mikesol , review @ unmock/unmock-js#327 would be appreciated.
    Mike Solomon
    @mikesol
    My apologies, it had looked like @bukharim96 's PR had passed the tests, but for some reason it was not being automatically built on our Circle CI and has several linting/installation errors. These are all quite small fixes, so we can fix them in the repo itself, but I'm wondering if there is a better way to set up safeguards against this in the future?
    Kimmo Sääskilahti
    @ksaaskil
    We can switch on CI builds for forks ( passing secrets).
    without
    Sorry for that. So without passing secrets, I meant 😁
    Mike Solomon
    @mikesol
    The Circle CI demo went great. They are interested in an unmock webinar, and unmock youtube video and re-featuring the new unmock orb. Three cheers for @ksaaskil that made the stuff!! :confetti_ball:
    Kimmo Sääskilahti
    @ksaaskil
    Cool 😊
    Enabled CircleCI builds for forked pull requests in unmock-js, did the same for unmock.github.io while I was there (ping @carolstran )
    mohsenatigh
    @mohsenatigh
    Hi. Do you guys have any c,c++ and GO opportunities?
    Kimmo Sääskilahti
    @ksaaskil
    @mohsenatigh Please send job enquiries to jobs@meeshkan.com with a story of yourself, your motivation to work for us and a free-form CV, thanks!