Message from JavaScript discussions
August 2017
— Guys, got another philosophy question 🤔
Is it better to place tests inside the src/ folder (so they are afterwards compiled to our dist/ folder) or leave them out of it and include them in a different build process?
— I use jasmine which puts it's tests in spec
directory
— I've been playing all afternoon with Typescript and eventually I came across two different approaches... mocha+chai which requires compiling the tests or Jest which doesn't
— Hmm
— What's the spec directory for?
— I am pretty sure you can make them optional if you use npm, using the devDependencies
field in package.json
— Should they be optional?
— For production builds I don't include tests, but I don't know of any reason not to
— Ugh. I'm used to Salesforce platform where you have to carry your tests EVERYWHERE
— But no idea what Node best practices are
— Haha