Code Monkey home page Code Monkey logo

Comments (5)

edosrecki avatar edosrecki commented on June 12, 2024 1

@af Looks good thanks!

from envalid.

af avatar af commented on June 12, 2024

Hmm, if I'm understanding correctly, the following test cases should catch this. When I try the latest version, they throw EnvMissingError as expected. Could you try them locally and confirm, or find a way to modify them so they catch this error?

https://github.com/af/envalid/blob/46beac10cb5e3b78b085bc8d11f8e3a45f1bd4b9/tests/basics.test.ts#L247-L242

from envalid.

edosrecki avatar edosrecki commented on June 12, 2024

@af Sorry, I wasn't fully clear, if NODE_ENV is not test or production, envalid will set value to testOnlySymbol and proceed normally.

I believe that the tests that you linked should be modified to this:

process.env.NODE_ENV = 'production'
expect(() => cleanEnv({ NODE_ENV: 'production' }, makeSpec(), makeSilent)).toThrow()

process.env.NODE_ENV = 'development'
// THIS DOESN'T HOLD ANYMORE
expect(() => cleanEnv({ NODE_ENV: 'development' }, makeSpec(), makeSilent)).toThrow() 
process.env.NODE_ENV = processEnv

from envalid.

edosrecki avatar edosrecki commented on June 12, 2024

@af did you have time to look into this?

from envalid.

af avatar af commented on June 12, 2024

@edosrecki Finally did, sorry about the delay! You were right, there was a bug. Could you check out #200 and let me know if it works correctly for you now?

from envalid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.