-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Tests & 100% Code Coverage (+ some related standardization) #9
Commits on Dec 1, 2019
-
(test): add initial test harness and one simple test
- ensure that width/height of canvas are trimmed down after drawing a purple rectangle in the center - add test script that uses jest - (ci): change CI to run test and test:pub - configure jest and babel-jest - add coverage/ directory to gitignore - add babel-jest@23 for Babel 6 support - and configure it for .js files due to a jest bug - add .babelrc to configure babel-jest - can't use .babelrc.js as babel-jest@23 doesn't support it - jestjs/jest#5324 - can't use .babelrc for babel-loader (have to duplicate config) because babel-loader@6 has some bugs with it and babel-loader@7 doesn't support webpack@1 - babel/babel-loader#552 (deps): add jest, babel-jest, and canvas-prebuilt to devDeps - add canvas-prebuilt@1 to support jest's jsdom v11 - canvas is used by jsdom for, well, canvas interactions
Configuration menu - View commit details
-
Copy full SHA for a5690f6 - Browse repository at this point
Copy the full SHA a5690f6View commit details -
(test): make test more complex to handle more use cases
- so it's not just handling one single square in the middle, make the shape more complex to ensure algorithm works properly
Configuration menu - View commit details
-
Copy full SHA for f0d1505 - Browse repository at this point
Copy the full SHA f0d1505View commit details -
(test): ensure edge case of all whitespace is handled
- currently returns a 1x1 canvas... should probably be 0x0, but that requires some refactoring and may be a breaking change if anyone is relying on that behavior - reliance on that behavior may certainly be possible given how long this library has gone without a release, though no one's reported that as a bug either - it's a pretty big edge case, so I'm not sure that it matters much either way tbh - also, this gets us to 100% code coverage!!
Configuration menu - View commit details
-
Copy full SHA for 614baef - Browse repository at this point
Copy the full SHA 614baefView commit details -
(ci/test): add CodeCov test coverage reporting
- change CI to output and upload coverage reports - (docs): add dat slick coverage: 100% badge to README
Configuration menu - View commit details
-
Copy full SHA for c8b1ff0 - Browse repository at this point
Copy the full SHA c8b1ff0View commit details -
(refactor): move index.js into src/
- standardize w/ the rest of my libraries and better parity between test/ and src/
Configuration menu - View commit details
-
Copy full SHA for 46121d0 - Browse repository at this point
Copy the full SHA 46121d0View commit details
Commits on Dec 2, 2019
-
(refactor): use const everywhere instead of let
- none of these variables are ever re-assigned - and new standard linter versions error on that - I wrote this a while ago when ES6 was new and just used `let` for everything instead of `var` at the time. Now ofc I use `const` everywhere and `let` when needed - also replace `var` in for loops with block-scoped `let` - change docs to use const as well
Configuration menu - View commit details
-
Copy full SHA for 16174e4 - Browse repository at this point
Copy the full SHA 16174e4View commit details -
(env/refactor): standardize .gitignore
- basically the same one I use in all my other libraries - I believe it's an old version of Node output from gitignore.io iirc - it has comments unlike the old one, so that's much nicer for those who aren't totally sure what each entry is for
Configuration menu - View commit details
-
Copy full SHA for 2435a1b - Browse repository at this point
Copy the full SHA 2435a1bView commit details