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

Test Framework #1331

Merged
merged 3 commits into from Aug 6, 2015
Merged

Test Framework #1331

merged 3 commits into from Aug 6, 2015

Conversation

jkruder
Copy link
Contributor

@jkruder jkruder commented Aug 4, 2015

Test framework has been created using Karma/Mocha/Chai/Sinon/PhantomJS (SauceLabs for CI is in the works). Tests should be added under the test/ directory. Any test fixtures that you may create should be placed under test/fixtures/. A sample test file has been created verifying some behaviors of the Checkbox component (this is intentionally not complete -- I wanted to get this out to the community so that we can all start contributing tests). Tests will be written in ES6 and transpiled to ES5.

Test coverage is handled by Istanbul. However, Istanbul has a bug that is currently preventing it from generating HTML reports so we'll need to depend upon something that can process the LCOV reports (travis). Test results (pass/fail) and coverage summaries are dumped to the console (a detailed text report is also generated under the coverage\ directory).

To have Karma watch your test files, run npm run test-watch. To perform a single run, execute npm test. If we want to integrate Karma with Gulp, we can do that. I chose not to because it is trivial to run the tests and I did not want to incur the overhead of spinning up/down Karma's server.

Note that a browser-polyfill is required for PhantomJS 1.9.X.

Resolves #396

hai-cea added a commit that referenced this pull request Aug 6, 2015
@hai-cea hai-cea merged commit 656db5e into mui:master Aug 6, 2015
@hai-cea
Copy link
Member

hai-cea commented Aug 6, 2015

Sweet - thanks @jkruder 👍

@jkruder
Copy link
Contributor Author

jkruder commented Aug 7, 2015

Let there be testing!

@jkruder
Copy link
Contributor Author

jkruder commented Aug 7, 2015

Something I found out the hard way: engine.io-client is a dependency of socket.io-client and engin.io-client has a dependency on an archived git repo. So anyone trying to use material-ui behind a firewall/company intranet may run into some issues. There is a PR to resolve the engine.io-client dependency issue. I can't say when it will be resolved, but hopefully soon.

A workaround: Stand up nexus (>2.10) or some other NPM hosting product and download/obtain the source for engine.io-client and the github dependency. Modify the github dep's package.json and give it a version number (something in the 0.0.X range or even 0.0.0-beta) and then add it to your hosted npm registry. Update the engine.io-client package.json so that the github dep is the version number you selected in the previous step. Upload engine.io-client into your npm registry. Configure your registry so that it serves up the deps that you just loaded before searching other repos. That should temporarily address the issue with Karma until it is resolved permanently

@zannager zannager added the test label Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Test Suite
3 participants