diff options
| author | Stephen Blott | 2014-10-30 07:48:00 +0000 |
|---|---|---|
| committer | Stephen Blott | 2014-10-30 07:48:00 +0000 |
| commit | 8afdaabd2e66a3092bc2b122443956327e0ba679 (patch) | |
| tree | 14c28a3191ebceb3b1859487e3f712fb964d4d80 | |
| parent | a277fa6332f3aa3c0aa5f2c541f539fb1569c6b9 (diff) | |
| parent | 1bba5d27ab548b2a05e987695653ecf07cdb337c (diff) | |
| download | vimium-8afdaabd2e66a3092bc2b122443956327e0ba679.tar.bz2 | |
Merge branch 'fix-tests' of github.com:mrmr1993/vimium
| -rw-r--r-- | tests/unit_tests/commands_test.coffee | 5 | ||||
| -rw-r--r-- | tests/unit_tests/exclusion_test.coffee | 4 | ||||
| -rw-r--r-- | tests/unit_tests/settings_test.coffee | 2 | ||||
| -rw-r--r-- | tests/unit_tests/test_chrome_stubs.coffee | 9 | ||||
| -rw-r--r-- | tests/unit_tests/utils_test.coffee | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/unit_tests/commands_test.coffee b/tests/unit_tests/commands_test.coffee index c10c643b..daaef016 100644 --- a/tests/unit_tests/commands_test.coffee +++ b/tests/unit_tests/commands_test.coffee @@ -1,8 +1,5 @@ -root.chrome = - session: - MAX_SESSION_RESULTS: 25 - require "./test_helper.js" +extend global, require "./test_chrome_stubs.js" {Commands} = require "../../background_scripts/commands.js" context "Key mappings", diff --git a/tests/unit_tests/exclusion_test.coffee b/tests/unit_tests/exclusion_test.coffee index a24c3b67..25bd8125 100644 --- a/tests/unit_tests/exclusion_test.coffee +++ b/tests/unit_tests/exclusion_test.coffee @@ -1,13 +1,13 @@ require "./test_helper.js" -require "./test_chrome_stubs.js" +extend global, require "./test_chrome_stubs.js" # FIXME: # Would like to do: # extend(global, require "../../background_scripts/marks.js") # But it looks like marks.coffee has never been included in a test before! # Temporary fix... -root.Marks = +root.Marks = create: () -> true goto: bind: () -> true diff --git a/tests/unit_tests/settings_test.coffee b/tests/unit_tests/settings_test.coffee index 1283497c..4625457b 100644 --- a/tests/unit_tests/settings_test.coffee +++ b/tests/unit_tests/settings_test.coffee @@ -1,5 +1,5 @@ require "./test_helper.js" -require "./test_chrome_stubs.js" +extend global, require "./test_chrome_stubs.js" extend(global, require "../../lib/utils.js") Utils.getCurrentVersion = -> '1.44' diff --git a/tests/unit_tests/test_chrome_stubs.coffee b/tests/unit_tests/test_chrome_stubs.coffee index 9622f85f..2abd26c9 100644 --- a/tests/unit_tests/test_chrome_stubs.coffee +++ b/tests/unit_tests/test_chrome_stubs.coffee @@ -5,10 +5,10 @@ # It also provides stubs for a number of other chrome APIs. # -global.window = {} -global.localStorage = {} +exports.window = {} +exports.localStorage = {} -global.chrome = +exports.chrome = runtime: getManifest: () -> version: "1.2.3" @@ -56,6 +56,9 @@ global.chrome = items[key] = {} @func(items,'synced storage stub') + session: + MAX_SESSION_RESULTS: 25 + # chrome.storage.sync sync: store: {} diff --git a/tests/unit_tests/utils_test.coffee b/tests/unit_tests/utils_test.coffee index c4139dbb..76a023ed 100644 --- a/tests/unit_tests/utils_test.coffee +++ b/tests/unit_tests/utils_test.coffee @@ -1,5 +1,5 @@ require "./test_helper.js" -require "./test_chrome_stubs.js" +extend global, require "./test_chrome_stubs.js" extend(global, require "../../lib/utils.js") Utils.getCurrentVersion = -> '1.43' extend(global, require "../../background_scripts/sync.js") |
