mirror of
https://github.com/konvajs/konva.git
synced 2025-05-03 04:13:55 +08:00
changed test to warn for node and shape selector unit test, and added more info in the README Testing section
This commit is contained in:
parent
266026c76f
commit
5705d909e5
@ -6,9 +6,9 @@ To build a development version of the library, run `thor build:dev VERSION`, whe
|
||||
If you add a file in the src directory, be sure to add the filename to the filename array in the Thorfile.
|
||||
|
||||
#Testing
|
||||
To run unit tests, you'll need to build the `unitTests.js` file by running `thor build:test` and then opening `unitTests.html` in the `tests/html` directory. The other tests can be ran directly by opening `functionalTests.html`, `manualTests.html`, or `performanceTests.html` in the `tests/html` directory. Unit, functional, and performance tests output the results to the console via `console.log()` so be sure to have it open.
|
||||
To run unit tests, you'll need to build the `unitTests.js` file by running `thor build:test` and then opening `unitTests.html`. You can navigate to all of the test suites by opening up `tests/html/index.html`. Unit, functional, and performance tests output the results to the console via `console.log()` so be sure to have it open.
|
||||
|
||||
To add / modify unit tests, be sure to do so in the `tests/js/unit` directory, because these are the source test files that are concatenated together when building `unitTests.js`. Use `test()` for hard tests which will throw an error if something fails, and use `warn()` for soft tests that will allow the tests to continue if the test condition fails. The `warn()` method is great for tests that will have different results in different browsers, such as canvas data url comparisons, text metric dimensions, etc. All tests should pass in Google Chrome with no warnings, and all tests should pass with some warnings in other browsers.
|
||||
To add / modify unit tests, be sure to do so in the `tests/js/unit` directory, because these are the source test files that are concatenated together when building `unitTests.js`. Use `test()` for hard tests which will throw an error if something fails, and use `warn()` for soft tests that will allow the tests to continue if the test condition fails. The `warn()` method is great for tests that will have different results in different browsers, such as canvas data url comparisons, text metric dimensions, etc. All tests should pass in Google Chrome with no warnings, and all tests should pass with some warnings in other browsers. Also, in order for data url tests and image manipulation tests to pass, you need to run the unit test suite on a web server.
|
||||
|
||||
TIP: prepend a test name with a `*` to only run that particular test, or prepend a test name with `!` to omit that test.
|
||||
|
||||
|
@ -627,7 +627,7 @@ Test.Modules.CONTAINER = {
|
||||
|
||||
stage.toDataURL({
|
||||
callback: function(dataUrl) {
|
||||
test(dataUrl === dataUrls['node shape type selector'], 'problem with node and shape type selector render.');
|
||||
warn(dataUrl === dataUrls['node shape type selector'], 'problem with node and shape type selector render.');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user