Skip to content
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

Setup JEST #12

Closed
3 tasks
teesloane opened this issue Apr 29, 2017 · 3 comments
Closed
3 tasks

Setup JEST #12

teesloane opened this issue Apr 29, 2017 · 3 comments

Comments

@teesloane
Copy link
Contributor

teesloane commented Apr 29, 2017

we will use JEST for writing unit tests. This requires the following

  • install jest
  • set up a methodology for testing (ie. should we use a seperate folder? have a *.spec.js for each js file in parallel?
  • adding information to our README for how to run tests
@mackiedrew
Copy link
Contributor

I've always used *.test.js, What does *.spec.js stand for? I'm not sold on either, just curious. 😄

@teesloane teesloane mentioned this issue May 1, 2017
@teesloane
Copy link
Contributor Author

I actually don't know exactly why it's spec ; i figure specification is relatively synonymous with test heh. Maybe someone else can weigh in on this...

@mackiedrew
Copy link
Contributor

I'll do jest too I suppose. I love the tooling stuff!

teesloane pushed a commit that referenced this issue May 2, 2017
* Added Jest and Sinon as for automated testing

I added Jest because it is addressed in the issue #12. It is also
the growing standard, and easy for individuals to pick up if they
have never touched unit testing before. Sinon is a non-framework
dependant JavaScript mocking library. This means either Jest or
Sinon could be swapped out more easilly later.

I have set the current coverage cut off to a typically low 30%.
This is to make unit tests not absolutely required for participation
in the project.

I've taken the libery of writing the first function's tests to
help test the test suite, and provide a template for people to
checkout if they want to write laters. The function is pipe().

I've written robust documentation and put it in README.md

* Requested changes are made after code review

Changes are as follows:

- README.md reflects new test folder name
- README.md is present tense where required
- Tense is corrected in test file.
- __tests__/ is now test/
- jestSetup.js is now in the snippet/test/ directory
- jestSetup.js is now called setup.js
teesloane pushed a commit that referenced this issue May 21, 2017
* Added json-server dependency to package.json

* Added a db template to track emojion values

* Changed numerical variables to actual emoji objects to easier associate data.

* Fixed db.json template to parse nicely to frontend state

* Initial 'hello world' for flask startup setup.

* MANIFEST.in used to specify
package to be included in
flask directory.

* flask database with 2 sample items

* To initialize flask

* setup packages

* sample schema.sql database

* styling and layout for flask backend

* contains main flask functions for db usage

* Removing initial flask pull request. Will make a
simpler flask back end with only a few pull
requests.

* Code Session 1: Pipe Scaffolding

- Quite a bit of work done here to scaffold
out the basic structure and first few functions
of our function pipe.

- Made an example page to mount the emojion bar in
- Created the function pipe (needs work!)
- Made a state object to pass through the pipe and alter as it flows down
- Made our own custom containers for mounting the emoji bar in and made them show up.

* Set up elm inside the `client` folder. (#24)

- This adds elm with an empty application to the file.
- I created a README.md in the `client/` folder to speed up getting onboard.

* Add elm instructions and scaffold basic site (#27)

- this commit adds some instructions to the main readme for getting
started with Elm.
- I experimented with creating a little toggle button to become familiar
with the elm syntax.
- Eventually this will be replaced with some basic functionality based on
the wireframe for client (that does not exist currently)
- Clean up comments to be proper multiline

* Snippet: Added Jest and Sinon for automated testing  (#26)

* Added Jest and Sinon as for automated testing

I added Jest because it is addressed in the issue #12. It is also
the growing standard, and easy for individuals to pick up if they
have never touched unit testing before. Sinon is a non-framework
dependant JavaScript mocking library. This means either Jest or
Sinon could be swapped out more easilly later.

I have set the current coverage cut off to a typically low 30%.
This is to make unit tests not absolutely required for participation
in the project.

I've taken the libery of writing the first function's tests to
help test the test suite, and provide a template for people to
checkout if they want to write laters. The function is pipe().

I've written robust documentation and put it in README.md

* Requested changes are made after code review

Changes are as follows:

- README.md reflects new test folder name
- README.md is present tense where required
- Tense is corrected in test file.
- __tests__/ is now test/
- jestSetup.js is now in the snippet/test/ directory
- jestSetup.js is now called setup.js

* Add information about the `client`

- naming for the "client" part of the project is not the most  clear
- i also included more information regarding the mono-repo structure of the
project

* Simplifying the example.html page (#28) (#30)

* Update README.md

* Adding CircleCI Integration (#31)

* Added first basic CircleCI configuration

I am overriding with yarn to match intended usage. This is because
without specifying it will default to NPM. Additionally, I have
specified CircleCI to run the test suite when running the build.

* Moved the circle.yml so it would be recognised

- Need to specify pwd: <DIRECTORY> so that it will (hopefully)
run in the proper directory.

This is the first time I've done this multi-package repo thing so
this may fail again.

* Removed specified build directory to allow

Allowing for future ability to test all the packages.

* Fixed malformed YAML, needs double indents for pwd

* Fixed spelling "snippet" as "snippets"

* Specifying node version for stability

* First test at getting an elm build to work

* Added elm prompt automatically saying yes

* Trying to speed up CI for elm with caching

* Fixed bad paths I had specified previously

* Fixed cached path for elm

* Added CircleCI badge

- Trying another cache experiment

* Final tweaks, mostly to test another build on CI

* Temporarily disabling the elm integration

* Add badge for repo.

* 7 inline stylesheet (#34)

* Create function that adds style tag to head

* Created function to add a style tag for the emojion bar to the head

* Added issue and pull request templates (#35)

* Added issue and pull request templates

Issue and pull request templates help keep a consistent format and
remind people about the contribution guidelines without

This addresses Issue #32.

* Added a screenshots section to both templates

* Refactored the `pipe` function for readability (#33)

* Refactored the `pipe` function for readability

It is more readable with proper JS Docs and reduce-relevant
variable names. As the core of the snippet it is key for it to be
very clear and understandable.

* Made code review requested changes

* [#7] Adaptive Styling (#37)

* Fix issue where container was added to <style>

- Containers added to all id’s
- Formulate new id for <style> tag not using EMOJION_ID
- Create EMOJION_NAMESPACE, purposely different to EMOJION_ID

* Add function to style emojion bars

- Use style id const
- Add dummy styles
- Run through pipe

* Add responsive wrapper and styles to elements

- Aid testing responsive design of emojion bar

* Add basic wireframe styling

- Hover effect
- Implement flexbox

* Snippet
- Restyle emojion bar based on comments in PR (limit of icons)
- Update classes (BEM) and remove whitespace between elements

Example
- Rewrite example to better display emojion bar with real-life example of a comments section
- BEM classes
- Test examples

* Cleanup styles and spacing

- Add responsive media query for comments

* Add borders to emojion bar to better fit wireframe

- Implement styles from old commit

* Add style-less test example

- Create comment with no classes

* Style container to better fit wireframe

- Responsive styles for container
- Add flexbox
- Make container full width like wireframe
- Add extra icon

* Add .editorconfig to unify coding styles across developers (#38)

* Create editorconfig file at the root

- Define code styles for all file types based on current styles
- Make specific rules for .markdown and .html

* Cleanup html inline with editorconfig

* Fix html

- body and head were out of line

* Revert "Fix html"

This reverts commit b71c7f9.

* Revert "Cleanup html inline with editorconfig"

This reverts commit 76f66c0.

* Replace html style with elm

- Add .elm based on comments from teesloane

* Add a couple of tests to snippet (#39)

Re issue #13:
Creates test for getAllIds & makeEmojionBar

* 5 emojibar state (#40)

* Create function that adds style tag to head

* Created function to add a style tag for the emojion bar to the head

* Created preliminary code for the increment emoji function

* Added a function that is supposed to increment the emoji count, however it currently increments the count of all emojis within a container (when you click the container, not the emoji) once, and then proceeds to increment the first emoji in the container, no matter which emoji you make an attempt to click on

* Synced changes with development branch

* Emojion click listeners works!

* basic elm hackery. Making a header for the client!

* Use native elm-css for type-safe CSS. (#42)

* Add elm-live development server support.

* Replaced hardcoded css with elm-css. Also renamed main.elm to Main.elm (Elm
standard) and cleaned it up a bit.

* Added json-server dependency to package.json

* Added a db template to track emojion values

* Changed numerical variables to actual emoji objects to easier associate data.

* Fixed db.json template to parse nicely to frontend state

* Add npm script for running dummy api

* Issue#29 Refactoring ids to classes (#45)

* updated from ids to class

* refactored from ids to classes

* Incrementing counters no longer causes the emoji bar to jitter (#41) (#46)

* Refactoring (#47)

* updated from ids to class

* refactored from ids to classes

* improved className finding by utilizing filter method

* removed comments

* Clean up + renaming + trying to fix tests.

We are switching to mounting our emojion bar based on class dom selectors
rather than IDs.

this broke some test and required some renaming.

* Add basic client UI (#48)

* A custom zipper for selected state.

* Implemented a bare-bones selection and reordering system.

* Add documentation to Zipper.

* Added some documentation for Main.

* Update README.md

* Update README.md

* Initial 'hello world' for flask startup setup.

* MANIFEST.in used to specify
package to be included in
flask directory.

* flask database with 2 sample items

* To initialize flask

* setup packages

* sample schema.sql database

* styling and layout for flask backend

* contains main flask functions for db usage

* Removing initial flask pull request. Will make a
simpler flask back end with only a few pull
requests.

* setting up flask infrastructure.

* setup flask infrastructure

* Restructured dummy db, fixed emoji GET request.

* Removed console log
teesloane pushed a commit that referenced this issue May 23, 2017
* Added json-server dependency to package.json

* Added a db template to track emojion values

* Changed numerical variables to actual emoji objects to easier associate data.

* Fixed db.json template to parse nicely to frontend state

* Initial 'hello world' for flask startup setup.

* MANIFEST.in used to specify
package to be included in
flask directory.

* flask database with 2 sample items

* To initialize flask

* setup packages

* sample schema.sql database

* styling and layout for flask backend

* contains main flask functions for db usage

* Removing initial flask pull request. Will make a
simpler flask back end with only a few pull
requests.

* Code Session 1: Pipe Scaffolding

- Quite a bit of work done here to scaffold
out the basic structure and first few functions
of our function pipe.

- Made an example page to mount the emojion bar in
- Created the function pipe (needs work!)
- Made a state object to pass through the pipe and alter as it flows down
- Made our own custom containers for mounting the emoji bar in and made them show up.

* Set up elm inside the `client` folder. (#24)

- This adds elm with an empty application to the file.
- I created a README.md in the `client/` folder to speed up getting onboard.

* Add elm instructions and scaffold basic site (#27)

- this commit adds some instructions to the main readme for getting
started with Elm.
- I experimented with creating a little toggle button to become familiar
with the elm syntax.
- Eventually this will be replaced with some basic functionality based on
the wireframe for client (that does not exist currently)
- Clean up comments to be proper multiline

* Snippet: Added Jest and Sinon for automated testing  (#26)

* Added Jest and Sinon as for automated testing

I added Jest because it is addressed in the issue #12. It is also
the growing standard, and easy for individuals to pick up if they
have never touched unit testing before. Sinon is a non-framework
dependant JavaScript mocking library. This means either Jest or
Sinon could be swapped out more easilly later.

I have set the current coverage cut off to a typically low 30%.
This is to make unit tests not absolutely required for participation
in the project.

I've taken the libery of writing the first function's tests to
help test the test suite, and provide a template for people to
checkout if they want to write laters. The function is pipe().

I've written robust documentation and put it in README.md

* Requested changes are made after code review

Changes are as follows:

- README.md reflects new test folder name
- README.md is present tense where required
- Tense is corrected in test file.
- __tests__/ is now test/
- jestSetup.js is now in the snippet/test/ directory
- jestSetup.js is now called setup.js

* Add information about the `client`

- naming for the "client" part of the project is not the most  clear
- i also included more information regarding the mono-repo structure of the
project

* Simplifying the example.html page (#28) (#30)

* Update README.md

* Adding CircleCI Integration (#31)

* Added first basic CircleCI configuration

I am overriding with yarn to match intended usage. This is because
without specifying it will default to NPM. Additionally, I have
specified CircleCI to run the test suite when running the build.

* Moved the circle.yml so it would be recognised

- Need to specify pwd: <DIRECTORY> so that it will (hopefully)
run in the proper directory.

This is the first time I've done this multi-package repo thing so
this may fail again.

* Removed specified build directory to allow

Allowing for future ability to test all the packages.

* Fixed malformed YAML, needs double indents for pwd

* Fixed spelling "snippet" as "snippets"

* Specifying node version for stability

* First test at getting an elm build to work

* Added elm prompt automatically saying yes

* Trying to speed up CI for elm with caching

* Fixed bad paths I had specified previously

* Fixed cached path for elm

* Added CircleCI badge

- Trying another cache experiment

* Final tweaks, mostly to test another build on CI

* Temporarily disabling the elm integration

* Add badge for repo.

* 7 inline stylesheet (#34)

* Create function that adds style tag to head

* Created function to add a style tag for the emojion bar to the head

* Added issue and pull request templates (#35)

* Added issue and pull request templates

Issue and pull request templates help keep a consistent format and
remind people about the contribution guidelines without

This addresses Issue #32.

* Added a screenshots section to both templates

* Refactored the `pipe` function for readability (#33)

* Refactored the `pipe` function for readability

It is more readable with proper JS Docs and reduce-relevant
variable names. As the core of the snippet it is key for it to be
very clear and understandable.

* Made code review requested changes

* [#7] Adaptive Styling (#37)

* Fix issue where container was added to <style>

- Containers added to all id’s
- Formulate new id for <style> tag not using EMOJION_ID
- Create EMOJION_NAMESPACE, purposely different to EMOJION_ID

* Add function to style emojion bars

- Use style id const
- Add dummy styles
- Run through pipe

* Add responsive wrapper and styles to elements

- Aid testing responsive design of emojion bar

* Add basic wireframe styling

- Hover effect
- Implement flexbox

* Snippet
- Restyle emojion bar based on comments in PR (limit of icons)
- Update classes (BEM) and remove whitespace between elements

Example
- Rewrite example to better display emojion bar with real-life example of a comments section
- BEM classes
- Test examples

* Cleanup styles and spacing

- Add responsive media query for comments

* Add borders to emojion bar to better fit wireframe

- Implement styles from old commit

* Add style-less test example

- Create comment with no classes

* Style container to better fit wireframe

- Responsive styles for container
- Add flexbox
- Make container full width like wireframe
- Add extra icon

* Add .editorconfig to unify coding styles across developers (#38)

* Create editorconfig file at the root

- Define code styles for all file types based on current styles
- Make specific rules for .markdown and .html

* Cleanup html inline with editorconfig

* Fix html

- body and head were out of line

* Revert "Fix html"

This reverts commit b71c7f9.

* Revert "Cleanup html inline with editorconfig"

This reverts commit 76f66c0.

* Replace html style with elm

- Add .elm based on comments from teesloane

* Add a couple of tests to snippet (#39)

Re issue #13:
Creates test for getAllIds & makeEmojionBar

* 5 emojibar state (#40)

* Create function that adds style tag to head

* Created function to add a style tag for the emojion bar to the head

* Created preliminary code for the increment emoji function

* Added a function that is supposed to increment the emoji count, however it currently increments the count of all emojis within a container (when you click the container, not the emoji) once, and then proceeds to increment the first emoji in the container, no matter which emoji you make an attempt to click on

* Synced changes with development branch

* Emojion click listeners works!

* basic elm hackery. Making a header for the client!

* Use native elm-css for type-safe CSS. (#42)

* Add elm-live development server support.

* Replaced hardcoded css with elm-css. Also renamed main.elm to Main.elm (Elm
standard) and cleaned it up a bit.

* Added json-server dependency to package.json

* Added a db template to track emojion values

* Changed numerical variables to actual emoji objects to easier associate data.

* Fixed db.json template to parse nicely to frontend state

* Add npm script for running dummy api

* Issue#29 Refactoring ids to classes (#45)

* updated from ids to class

* refactored from ids to classes

* Incrementing counters no longer causes the emoji bar to jitter (#41) (#46)

* Refactoring (#47)

* updated from ids to class

* refactored from ids to classes

* improved className finding by utilizing filter method

* removed comments

* Clean up + renaming + trying to fix tests.

We are switching to mounting our emojion bar based on class dom selectors
rather than IDs.

this broke some test and required some renaming.

* Add basic client UI (#48)

* A custom zipper for selected state.

* Implemented a bare-bones selection and reordering system.

* Add documentation to Zipper.

* Added some documentation for Main.

* Update README.md

* Update README.md

* Initial 'hello world' for flask startup setup.

* MANIFEST.in used to specify
package to be included in
flask directory.

* flask database with 2 sample items

* To initialize flask

* setup packages

* sample schema.sql database

* styling and layout for flask backend

* contains main flask functions for db usage

* Removing initial flask pull request. Will make a
simpler flask back end with only a few pull
requests.

* setting up flask infrastructure.

* setup flask infrastructure

* Restructured dummy db, fixed emoji GET request.

* Removed console log

* allowed changes to be merged successfully

* Enabled POST request from front to back end

* Took json data and dumped into snippet db

* Removed unecessary console.logs()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants