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

Unit testing initials #84

Merged

Conversation

adam-rocska
Copy link
Contributor

Unit Testing Initials

Scope

Provide the foundations of proper F.I.R.S.T. compliant Unit Tests, in a platform and client agnostic way.
For F.I.R.S.T. see : http://agileinaflash.blogspot.hu/2009/02/first.html

Introduced changes

Gitignore

I have added nbproject's private directory to the gitignore file, to save the headaches of others.

Package json

I have added mocha 2.4.5 as a dependency, and mocha test/unit as a test script. The reason for the hard-coded dependency is, that if in the future a patch or minor release would go out, that would break the current package, it won't have an impact on its users, as the loaded mocha version is not wildcarded.

Stubs

The stubs directory and its contents are bare-bone at the moment. Will be extended in the future, as coverage increase goes on.
The current stubs directory contents are only the ones that are vital for the instantiation of a Croppie object, and performing the first two test methods, which do assertions on the constructor.
Stubs interfaces are implemented according their related MDN documentation.

Information on test execution

The tests are executed in node.js, using Mocha, therefore they are way faster, than the traditional karma, jstestdriver, or other ways usually the community does.
Another benefit of this approach is, that it will force the developer, to actually mock all of its external dependencies, therefore there is a greater chance of F.I.R.S.T. compliant tests.
The stubs mimic the browser environment, that is the reason for "global pollution".

Regrets

As I could not find a coding styleguide / guideline to this repository, I have intentionally created this pull request with tabs, to be scolded, and receive the proper styleguide.

This was referenced Feb 22, 2016
thedustinsmith added a commit that referenced this pull request Feb 23, 2016
@thedustinsmith thedustinsmith merged commit b4b094e into Foliotek:master Feb 23, 2016
@thedustinsmith
Copy link
Contributor

Looks good, thanks! One day I'll actually go through and create a styleguide. And clean up existing files. Right now it's kind of a mess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants