aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJez Ng2012-01-10 01:05:38 +0800
committerJez Ng2012-01-10 01:32:12 +0800
commit03728546c28664deaf89b9d2dc8fe5fb630bcd9a (patch)
treef8bae4bc65e774217830e54bf7254af3b2912fea
parenta73f92604fca5380609f271685266cadf376ccbc (diff)
downloadvimium-03728546c28664deaf89b9d2dc8fe5fb630bcd9a.tar.bz2
Fix tests and make them easier to run.
Add instructions to the README about running tests.
-rw-r--r--README.markdown9
-rw-r--r--background_page.html7
-rw-r--r--test_harnesses/automated.html2
3 files changed, 17 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index 1a9294f5..54b584c1 100644
--- a/README.markdown
+++ b/README.markdown
@@ -124,6 +124,15 @@ discussion on the issues tracker or on the [mailing list][list_url]. If it mirro
another browser or in Vim itself, let us know! Once you've picked something to work on, add a comment to the
respective issue so others don't duplicate your effort.
+Please ensure that existing tests pass. The tests are defined in `test_harnesses/automated.html`. To run the
+tests:
+1. Go to the extensions page
+2. Click on the arrow beside Vimium to expand the menu, and then inspect `background_page.html` in the console
+3. Type in `runTests()`.
+
+We encourage you to write tests for any new features or bugfixes. Contributing more tests for existing
+features is great too!
+
When you're done, send us a pull request on Github. Feel free to include a change to the CREDITS file with
your patch.
diff --git a/background_page.html b/background_page.html
index 7d8f749d..4421ae2f 100644
--- a/background_page.html
+++ b/background_page.html
@@ -765,6 +765,13 @@
});
}
init();
+
+ /**
+ * Convenience function for development use.
+ */
+ function runTests() {
+ open(chrome.extension.getURL('test_harnesses/automated.html'));
+ }
</script>
</head>
</html>
diff --git a/test_harnesses/automated.html b/test_harnesses/automated.html
index 9f1b8007..e7d84413 100644
--- a/test_harnesses/automated.html
+++ b/test_harnesses/automated.html
@@ -117,7 +117,7 @@
}),
should("label the hints correctly", function() {
- var hintStrings = ["ss", "sa", "sd"];
+ var hintStrings = ["ss", "as", "ds"];
for (var i = 0; i < 3; i++)
assert.equal(hintStrings[i], linkHints.hintMarkers[i].getAttribute("hintString"));
}),