Open hancush opened 4 years ago
I am very glad to see you doing this! For the courts project, @jeancochrane and I added ESLint here: https://gitlab.com/court-transparency-project/charges-app/-/merge_requests/8
An advantage of ESLint is that it's built into the gatsby-starter-default
, but I've never compared it to JSHint and definitely support having standard styles for JS projects. Here's are the rules we landed on for courts: https://gitlab.com/court-transparency-project/charges-app/-/blob/master/.eslintrc.js
Oh myyyyy: I am tagged in a DataMade issue! @hancush I'd be happy to chat with you about how I've handled JS testing, linting, and auto-formatting this past year. "Slack me" if you'd like to set-up a call.
Code style (specifically, linting rules) is included in #78. Let's see how that goes, and assuming it covers the code style issue here, reorient this issue to be purely about testing.
We're all interested in this. The biggest team-wide hurdle is lack of knowledge about how to test React code — what does that look like, how does it work, what pieces of code/interaction do you test (unit tests, integration tests, etc)? This would be a good opportunity to train the entire team.
Hello old friends! I do not work here anymore....but I do work with React these days. RTL is the industry-standard test library: https://testing-library.com/docs/react-testing-library/intro/ It's wonderful.
Background
We use
flake8
andpytest
for code style and testing in Python. Many moons ago, @reginafcompton and I researched and proposed using the Node.js style guide and JSHint for style andjasmine
for testing in JavaScript, but they weren't broadly adopted by the team, in large part because we made limited use of JavaScript. As of 2020, that's changing!Proposal
We're learning JavaScript as a team, and the language offers many ways to achieve the same thing. Let's get ahead of the proliferation of idiosyncratic code and formally adopt style and testing standards.
As we've moved on from ES5, we should pick a style guide that aligns with ES6, and update our default
.jshintrc
to reflect the change.We should also revisit our chosen test framework. Does
jasmine
play will with Gatsby and React? If not, identify and adopt an alternative.Deliverables
javascript/
directory containing a pointers to our style guide and default linting config, and to our documentation on JavaScript testing.Timeline
I expect this project to take 1-2 days, depending on whether we can stick with
jasmine
or if we need to select a new testing framework.Connects #22.