├── Snippets ├── asc - assert called.tmSnippet ├── rec - refute called.tmSnippet ├── asd - assert defined.tmSnippet ├── asin - assert isNull.tmSnippet ├── cx - nested context.tmSnippet ├── red - refute defined.tmSnippet ├── rein - refute isNull.tmSnippet ├── asio - assert isObject.tmSnippet ├── asm - assert match.tmSnippet ├── ass - assert same.tmSnippet ├── ast - assert threw.tmSnippet ├── reio - refute isObject.tmSnippet ├── rem - refute match.tmSnippet ├── res - refute same.tmSnippet ├── ret - refute threw.tmSnippet ├── su - setup method.tmSnippet ├── asc2 - assert calledTwice.tmSnippet ├── asco - assert calledOn.tmSnippet ├── asco - assert calledOnce.tmSnippet ├── ase - assert equals.tmSnippet ├── rec1 - refute calledOnce.tmSnippet ├── rec2 - refute calledTwice.tmSnippet ├── reco - refute calledOn.tmSnippet ├── ree - refute equals.tmSnippet ├── td - teardown method.tmSnippet ├── asc3 - assert calledThrice.tmSnippet ├── ascc - assert callCount.tmSnippet ├── asif - assert isFunction.tmSnippet ├── asto - assert typeOf.tmSnippet ├── rec3 - refute calledThrice.tmSnippet ├── recc - refute callCount.tmSnippet ├── reif - refute isFunction.tmSnippet ├── reto - refute typeOf.tmSnippet ├── asco - assert callOrder.tmSnippet ├── astn - assert tagName.tmSnippet ├── asx - assert exception.tmSnippet ├── reco - refute callOrder.tmSnippet ├── retn - refute tagName.tmSnippet ├── rex - refute exception.tmSnippet ├── tt - additional test.tmSnippet ├── asat - assert alwaysThrew.tmSnippet ├── ascw - assert calledWith.tmSnippet ├── reat - refute alwaysThrew.tmSnippet ├── recw - refute calledWith.tmSnippet ├── ascn - assert className.tmSnippet ├── asid - assert inDelta.tmSnippet ├── recn - refute className.tmSnippet ├── reid - refute inDelta.tmSnippet ├── asaco - assert alwaysCalledOn.tmSnippet ├── reaco - refute alwaysCalledOn.tmSnippet ├── asacw - assert alwaysCalledWith.tmSnippet ├── reacw - refute alwaysCalledWith.tmSnippet ├── ascwe - assert calledWithExactly.tmSnippet ├── recwe - refute calledWithExactly.tmSnippet ├── asacwe - assert alwaysCalledWithExactly.tmSnippet ├── reacwe - refute alwaysCalledWithExactly.tmSnippet ├── tc - new testCase browser.tmSnippet ├── tc - new testCase node.tmSnippet └── tc - new testCase node+browser.tmSnippet ├── Commands ├── Run all tests.tmCommand └── Run current test file.tmCommand ├── info.plist └── README.md /Snippets/asc - assert called.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.called(${1:spy})$0 7 | name 8 | asc - assert called 9 | scope 10 | source.js 11 | tabTrigger 12 | asc 13 | uuid 14 | C3375264-B376-491F-B771-FF8FFF44EA13 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rec - refute called.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.called(${1:spy})$0 7 | name 8 | rec - refute called 9 | scope 10 | source.js 11 | tabTrigger 12 | rec 13 | uuid 14 | 20D510BF-5E75-4B1A-B65C-2310BC370A0F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asd - assert defined.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.defined(${1:object});$0 7 | name 8 | asd - assert defined 9 | scope 10 | source.js 11 | tabTrigger 12 | asd 13 | uuid 14 | 2C7AD6A1-E62C-4309-86AC-3925788E548F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asin - assert isNull.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.isNull(${1:object});$0 7 | name 8 | asin - assert isNull 9 | scope 10 | source.js 11 | tabTrigger 12 | asin 13 | uuid 14 | 32AA1855-A76E-4958-9839-AA57FF3C3A72 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/cx - nested context.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | "${1:context}": { 7 | tt$0 8 | } 9 | name 10 | cx - nested context 11 | scope 12 | source.js 13 | tabTrigger 14 | cx 15 | uuid 16 | 51C14331-4E21-457A-BF9D-79A461FF70D6 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/red - refute defined.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.defined(${1:object});$0 7 | name 8 | red - refute defined 9 | scope 10 | source.js 11 | tabTrigger 12 | red 13 | uuid 14 | CF4ADBEE-A729-4E42-817E-FA73BCD9EC8F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rein - refute isNull.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.isNull(${1:object});$0 7 | name 8 | rein - refute isNull 9 | scope 10 | source.js 11 | tabTrigger 12 | rein 13 | uuid 14 | 5E4F62E5-8AA5-48BA-B593-8512E8495F75 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asio - assert isObject.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.isObject(${1:object});$0 7 | name 8 | asio - assert isObject 9 | scope 10 | source.js 11 | tabTrigger 12 | asio 13 | uuid 14 | EF64D81A-B2DB-439C-AC18-67D228B3B900 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asm - assert match.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.match(${1:actual}, ${2:matcher}); 7 | name 8 | asm - assert match 9 | scope 10 | source.js 11 | tabTrigger 12 | asm 13 | uuid 14 | 20FE89AE-D53C-4524-8DF0-1800F0F22050 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ass - assert same.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.same(${1:actual}, ${2:expected});$0 7 | name 8 | ass - assert same 9 | scope 10 | source.js 11 | tabTrigger 12 | ass 13 | uuid 14 | 9B1B5759-CDCA-4E7C-852A-D919A498491C 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ast - assert threw.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.threw(${1:spy}, ${2:exception})$0 7 | name 8 | ast - assert threw 9 | scope 10 | source.js 11 | tabTrigger 12 | ast 13 | uuid 14 | 762B9437-A549-4DEF-8A28-4926A8C2ADFB 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reio - refute isObject.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.isObject(${1:object});$0 7 | name 8 | reio - refute isObject 9 | scope 10 | source.js 11 | tabTrigger 12 | reio 13 | uuid 14 | 5392DE45-2253-48D4-A61A-FBB8906A87A6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rem - refute match.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.match(${1:actual}, ${2:matcher}); 7 | name 8 | rem - refute match 9 | scope 10 | source.js 11 | tabTrigger 12 | rem 13 | uuid 14 | 3891A44B-658D-4501-AFFB-09B71C46FB18 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/res - refute same.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.same(${1:actual}, ${2:expected});$0 7 | name 8 | res - refute same 9 | scope 10 | source.js 11 | tabTrigger 12 | res 13 | uuid 14 | 5690EEC3-8A23-4C2D-A659-9D6B6EB37DAD 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ret - refute threw.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.threw(${1:spy}, ${2:exception})$0 7 | name 8 | ret - refute threw 9 | scope 10 | source.js 11 | tabTrigger 12 | ret 13 | uuid 14 | A46B9F2E-1BAE-4FC2-95C8-5858F3991998 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/su - setup method.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | setUp: function () { 7 | $0}, 8 | 9 | name 10 | su - setup method 11 | scope 12 | source.js.node 13 | tabTrigger 14 | su 15 | uuid 16 | AA6B70EB-19F7-4737-96DF-E902E6C43621 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/asc2 - assert calledTwice.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledTwice(${1:spy})$0 7 | name 8 | asc2 - assert calledTwice 9 | scope 10 | source.js 11 | tabTrigger 12 | asc2 13 | uuid 14 | 9B32090B-C465-4440-BF66-18F323645366 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asco - assert calledOn.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledOn(${1:spy}, ${2:obj})$0 7 | name 8 | asco - assert calledOn 9 | scope 10 | source.js 11 | tabTrigger 12 | asco 13 | uuid 14 | A8118100-2A53-4417-9AB6-8B58A0FCDE6D 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asco - assert calledOnce.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledOnce(${1:spy})$0 7 | name 8 | asc1 - assert calledOnce 9 | scope 10 | source.js 11 | tabTrigger 12 | asc1 13 | uuid 14 | 84E59300-83D9-4904-88E9-E4C0326B1BB4 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ase - assert equals.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.equals(${1:actual}, ${2:expected});$0 7 | name 8 | ase - assert equals 9 | scope 10 | source.js 11 | tabTrigger 12 | ase 13 | uuid 14 | 016835BD-9D1C-452F-8B57-2D73F1671BF0 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rec1 - refute calledOnce.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledOnce(${1:spy})$0 7 | name 8 | rec1 - refute calledOnce 9 | scope 10 | source.js 11 | tabTrigger 12 | rec1 13 | uuid 14 | 2119A88C-0BA9-472D-965D-692755A3EFC6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rec2 - refute calledTwice.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledTwice(${1:spy})$0 7 | name 8 | rec2 - refute calledTwice 9 | scope 10 | source.js 11 | tabTrigger 12 | rec2 13 | uuid 14 | FE420BC9-2958-441C-8153-1ABBE07F042D 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reco - refute calledOn.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledOn(${1:spy}, ${2:obj})$0 7 | name 8 | reco - refute calledOn 9 | scope 10 | source.js 11 | tabTrigger 12 | reco 13 | uuid 14 | 7C48064C-EF72-4657-A63F-43A6E2DCF687 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ree - refute equals.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.equals(${1:actual}, ${2:expected});$0 7 | name 8 | ree - refute equals 9 | scope 10 | source.js 11 | tabTrigger 12 | ree 13 | uuid 14 | C19B5310-B6FE-4EEF-91C5-7C95E0AEF5EB 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/td - teardown method.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | tearDown: function () { 7 | $0}, 8 | 9 | name 10 | td - teardown method 11 | scope 12 | source.js 13 | tabTrigger 14 | td 15 | uuid 16 | D27A1532-50CF-4073-9654-EFFCC4EF0780 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/asc3 - assert calledThrice.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledThrice(${1:spy})$0 7 | name 8 | asc3 - assert calledThrice 9 | scope 10 | source.js 11 | tabTrigger 12 | asc3 13 | uuid 14 | F89BDB77-1E18-45BF-99B4-696B4C4F55D8 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ascc - assert callCount.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.callCount(${1:spy}, ${2:count})$0 7 | name 8 | ascc - assert callCount 9 | scope 10 | source.js 11 | tabTrigger 12 | ascc 13 | uuid 14 | D0C6A469-D7EC-4776-A909-A3E052831B7E 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asif - assert isFunction.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.isFunction(${1:function});$0 7 | name 8 | asif - assert isFunction 9 | scope 10 | source.js 11 | tabTrigger 12 | asif 13 | uuid 14 | 84E592C9-98A7-47CA-A6C4-D1DCA13A4F38 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asto - assert typeOf.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.typeOf(${1:object}, ${2:expected});$0 7 | name 8 | asto - assert typeOf 9 | scope 10 | source.js 11 | tabTrigger 12 | asto 13 | uuid 14 | 4844B985-D53A-4BBF-A051-8A77F1C094B5 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rec3 - refute calledThrice.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledThrice(${1:spy})$0 7 | name 8 | rec3 - refute calledThrice 9 | scope 10 | source.js 11 | tabTrigger 12 | rec3 13 | uuid 14 | BE068A99-0270-4BEF-BD60-4FDDFC00DD90 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/recc - refute callCount.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.callCount(${1:spy}, ${2:count})$0 7 | name 8 | recc - refute callCount 9 | scope 10 | source.js 11 | tabTrigger 12 | recc 13 | uuid 14 | AC6364BE-2464-46BE-AEDD-DAB96BB1C13B 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reif - refute isFunction.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.isFunction(${1:function});$0 7 | name 8 | reif - refute isFunction 9 | scope 10 | source.js 11 | tabTrigger 12 | reif 13 | uuid 14 | 2DDF72AA-51DC-4430-945C-DC532C0CE790 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reto - refute typeOf.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.typeOf(${1:object}, ${2:expected});$0 7 | name 8 | reto - refute typeOf 9 | scope 10 | source.js 11 | tabTrigger 12 | reto 13 | uuid 14 | F4B009CE-4D03-47B4-93F1-EB7FA1127F0E 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asco - assert callOrder.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.callOrder(${1:spy1}, ${2:spy2, ...})$0 7 | name 8 | asco - assert callOrder 9 | scope 10 | source.js 11 | tabTrigger 12 | asco 13 | uuid 14 | 60DDB4F9-6794-46D7-B53C-FC956E245B56 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/astn - assert tagName.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.tagName(${1:element}, "${2:tagName}");$0 7 | name 8 | astn - assert tagName 9 | scope 10 | source.js 11 | tabTrigger 12 | astn 13 | uuid 14 | E02FAC5D-B131-4F6A-AF53-7BCD273CE86F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asx - assert exception.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.exception(function () { 7 | $0 8 | }); 9 | name 10 | asx - assert exception 11 | scope 12 | source.js 13 | tabTrigger 14 | asx 15 | uuid 16 | EADE6066-29BC-4D7C-B1AE-0F9632D08E07 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/reco - refute callOrder.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.callOrder(${1:spy1}, ${2:spy2, ...})$0 7 | name 8 | reco - refute callOrder 9 | scope 10 | source.js 11 | tabTrigger 12 | reco 13 | uuid 14 | ACE8FA2D-36B2-439A-8CF1-E6C810869055 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/retn - refute tagName.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.tagName(${1:element}, "${2:tagName}");$0 7 | name 8 | retn - refute tagName 9 | scope 10 | source.js 11 | tabTrigger 12 | retn 13 | uuid 14 | AA24F720-D060-46E1-A70A-308CBD5941D8 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/rex - refute exception.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.exception(function () { 7 | $0 8 | }); 9 | name 10 | rex - refute exception 11 | scope 12 | source.js 13 | tabTrigger 14 | rex 15 | uuid 16 | 6548DE73-1EBB-48B9-8C61-DEC7B36068C6 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/tt - additional test.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | "should ${3:do stuff}": function () { 7 | $0 8 | } 9 | name 10 | tt - additional test 11 | scope 12 | source.js 13 | tabTrigger 14 | tt 15 | uuid 16 | 1E343180-4299-4744-A794-007542E533CD 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/asat - assert alwaysThrew.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.alwaysThrew(${1:spy}, ${2:exception})$0 7 | name 8 | asat - assert alwaysThrew 9 | scope 10 | source.js 11 | tabTrigger 12 | asat 13 | uuid 14 | 00B69AF0-1559-4DE9-8CDE-5D9B1F04EB5B 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ascw - assert calledWith.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledWith(${1:spy}, ${2:arguments})$0 7 | name 8 | ascw - assert calledWith 9 | scope 10 | source.js 11 | tabTrigger 12 | ascw 13 | uuid 14 | DF79AC8C-450B-4653-B8F3-5F0FB234830B 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reat - refute alwaysThrew.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.alwaysThrew(${1:spy}, ${2:exception})$0 7 | name 8 | reat - refute alwaysThrew 9 | scope 10 | source.js 11 | tabTrigger 12 | reat 13 | uuid 14 | 815F94DC-1E4E-4E86-84E9-036D52BF3089 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/recw - refute calledWith.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledWith(${1:spy}, ${2:arguments})$0 7 | name 8 | recw - refute calledWith 9 | scope 10 | source.js 11 | tabTrigger 12 | recw 13 | uuid 14 | E413D22E-577B-406D-8B36-BFC3FFD666C6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ascn - assert className.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.className(${1:element}, "${2:className}");$0 7 | name 8 | ascn - assert className 9 | scope 10 | source.js 11 | tabTrigger 12 | ascn 13 | uuid 14 | 327FD992-A355-41EF-BFF7-2C6C9834D80B 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asid - assert inDelta.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.inDelta(${1:actual}, ${2:expected}, ${3:delta});$0 7 | name 8 | asid - assert inDelta 9 | scope 10 | source.js 11 | tabTrigger 12 | asid 13 | uuid 14 | FAE1F922-F493-4468-ADDD-657D054A3553 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/recn - refute className.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.className(${1:element}, "${2:className}");$0 7 | name 8 | recn - refute className 9 | scope 10 | source.js 11 | tabTrigger 12 | recn 13 | uuid 14 | D24A93BA-A700-4DD7-BD47-520DF4ECB21C 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reid - refute inDelta.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.inDelta(${1:actual}, ${2:expected}, ${3:delta});$0 7 | name 8 | reid - refute inDelta 9 | scope 10 | source.js 11 | tabTrigger 12 | reid 13 | uuid 14 | FC43AF81-7C64-4ABC-A76E-C4EEA2C4028F 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asaco - assert alwaysCalledOn.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.alwaysCalledOn(${1:spy}, ${2:obj})$0 7 | name 8 | asaco - assert alwaysCalledOn 9 | scope 10 | source.js 11 | tabTrigger 12 | asaco 13 | uuid 14 | DAFC2A49-C7F6-4427-8BC5-B5E082DE1EA6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reaco - refute alwaysCalledOn.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.alwaysCalledOn(${1:spy}, ${2:obj})$0 7 | name 8 | reaco - refute alwaysCalledOn 9 | scope 10 | source.js 11 | tabTrigger 12 | reaco 13 | uuid 14 | DFAF09E1-9ED4-48A4-A9A3-4286F926F7A1 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asacw - assert alwaysCalledWith.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.alwaysCalledWith(${1:spy}, ${2:arguments})$0 7 | name 8 | asacw - assert alwaysCalledWith 9 | scope 10 | source.js 11 | tabTrigger 12 | asacw 13 | uuid 14 | 8A1CC2B1-1165-406D-ADBE-68D5F1BD2CF1 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reacw - refute alwaysCalledWith.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.alwaysCalledWith(${1:spy}, ${2:arguments})$0 7 | name 8 | reacw - refute alwaysCalledWith 9 | scope 10 | source.js 11 | tabTrigger 12 | reacw 13 | uuid 14 | 958830BF-C3BD-4B62-9DC9-D7B23FE52DB5 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/ascwe - assert calledWithExactly.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.calledWithExactly(${1:spy}, ${2:arguments})$0 7 | name 8 | ascwe - assert calledWithExactly 9 | scope 10 | source.js 11 | tabTrigger 12 | ascwe 13 | uuid 14 | D2807B34-865C-4302-8695-40B92AD89F29 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/recwe - refute calledWithExactly.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.calledWithExactly(${1:spy}, ${2:arguments})$0 7 | name 8 | recwe - refute calledWithExactly 9 | scope 10 | source.js 11 | tabTrigger 12 | recwe 13 | uuid 14 | 50A4C9CE-08BB-4934-8742-173D069D6124 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/asacwe - assert alwaysCalledWithExactly.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | assert.alwaysCalledWithExactly(${1:spy}, ${2:arguments})$0 7 | name 8 | asacwe - assert alwaysCalledWithExactly 9 | scope 10 | source.js 11 | tabTrigger 12 | asacwe 13 | uuid 14 | 09868F60-8DF5-4E28-B4FA-F92922F920EA 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/reacwe - refute alwaysCalledWithExactly.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | refute.alwaysCalledWithExactly(${1:spy}, ${2:arguments})$0 7 | name 8 | reacwe - refute alwaysCalledWithExactly 9 | scope 10 | source.js 11 | tabTrigger 12 | reacwe 13 | uuid 14 | 2FB90C3A-70E6-4158-A324-9C9394C2D2A9 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/tc - new testCase browser.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | (function () { 7 | var assert = buster.assert; 8 | var refute = buster.refute; 9 | 10 | buster.testCase('${1:${TM_FILENAME/(.*?)(-|_)test.js/$1/}}', { 11 | tt$0 12 | }); 13 | }()); 14 | name 15 | tc - new testCase browser 16 | scope 17 | source.js 18 | tabTrigger 19 | tc 20 | uuid 21 | E704FDEB-934E-4D6D-897A-86F05675EBDE 22 | 23 | 24 | -------------------------------------------------------------------------------- /Snippets/tc - new testCase node.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | var buster = require('buster'); 7 | var assert = buster.assert; 8 | var refute = buster.refute; 9 | 10 | var ${2:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}} = require('../lib/${1:${TM_FILENAME/(.*?)(-|_)test.js/$1/}}'); 11 | 12 | buster.testCase("${3:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}}", { 13 | tt$0 14 | }); 15 | 16 | name 17 | tc - new testCase node 18 | scope 19 | source.js 20 | tabTrigger 21 | tc 22 | uuid 23 | BA7D6A9A-E6AE-4C35-B677-FE4E750597DE 24 | 25 | 26 | -------------------------------------------------------------------------------- /Commands/Run all tests.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env node 9 | 10 | process.chdir(process.env.TM_PROJECT_DIRECTORY); 11 | 12 | var cli = require("buster/node_modules/buster-test-cli").cli; 13 | 14 | cli.test.create().run(["-r", "html"]); 15 | 16 | input 17 | none 18 | keyEquivalent 19 | @R 20 | name 21 | Run all tests 22 | output 23 | showAsHTML 24 | scope 25 | source.js 26 | uuid 27 | EE8B1A9D-AB66-42E3-BB48-2A08C73EB90A 28 | 29 | 30 | -------------------------------------------------------------------------------- /Snippets/tc - new testCase node+browser.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | if (typeof require === "function" && typeof module !== "undefined") { 7 | var buster = require("buster"); 8 | var ${2:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}} = require('../lib/${1:${TM_FILENAME/(.*?)(-|_)test.js/$1/}}'); 9 | } 10 | 11 | (function () { 12 | var assert = buster.assert; 13 | var refute = buster.refute; 14 | 15 | buster.testCase('${3:${1/(?:_|-)([A-Za-z0-9]+)(?:\.js)?/(?2::\u$1)/g}}', { 16 | tt$0 17 | }); 18 | }()); 19 | name 20 | tc - new testCase node+browser 21 | scope 22 | source.js 23 | tabTrigger 24 | tc 25 | uuid 26 | 8366CBF2-890E-4B7B-BAFB-D583168FE5BC 27 | 28 | 29 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Buster 7 | ordering 8 | 9 | EE8B1A9D-AB66-42E3-BB48-2A08C73EB90A 10 | 0319EB36-7FE7-4E49-B4D5-6C502B30BFC2 11 | BA7D6A9A-E6AE-4C35-B677-FE4E750597DE 12 | E704FDEB-934E-4D6D-897A-86F05675EBDE 13 | 8366CBF2-890E-4B7B-BAFB-D583168FE5BC 14 | 1E343180-4299-4744-A794-007542E533CD 15 | 51C14331-4E21-457A-BF9D-79A461FF70D6 16 | AA6B70EB-19F7-4737-96DF-E902E6C43621 17 | D27A1532-50CF-4073-9654-EFFCC4EF0780 18 | DAFC2A49-C7F6-4427-8BC5-B5E082DE1EA6 19 | DFAF09E1-9ED4-48A4-A9A3-4286F926F7A1 20 | 8A1CC2B1-1165-406D-ADBE-68D5F1BD2CF1 21 | 958830BF-C3BD-4B62-9DC9-D7B23FE52DB5 22 | 09868F60-8DF5-4E28-B4FA-F92922F920EA 23 | 2FB90C3A-70E6-4158-A324-9C9394C2D2A9 24 | 00B69AF0-1559-4DE9-8CDE-5D9B1F04EB5B 25 | 815F94DC-1E4E-4E86-84E9-036D52BF3089 26 | D0C6A469-D7EC-4776-A909-A3E052831B7E 27 | AC6364BE-2464-46BE-AEDD-DAB96BB1C13B 28 | 60DDB4F9-6794-46D7-B53C-FC956E245B56 29 | ACE8FA2D-36B2-439A-8CF1-E6C810869055 30 | C3375264-B376-491F-B771-FF8FFF44EA13 31 | 20D510BF-5E75-4B1A-B65C-2310BC370A0F 32 | A8118100-2A53-4417-9AB6-8B58A0FCDE6D 33 | 7C48064C-EF72-4657-A63F-43A6E2DCF687 34 | 84E59300-83D9-4904-88E9-E4C0326B1BB4 35 | 2119A88C-0BA9-472D-965D-692755A3EFC6 36 | 9B32090B-C465-4440-BF66-18F323645366 37 | FE420BC9-2958-441C-8153-1ABBE07F042D 38 | F89BDB77-1E18-45BF-99B4-696B4C4F55D8 39 | BE068A99-0270-4BEF-BD60-4FDDFC00DD90 40 | DF79AC8C-450B-4653-B8F3-5F0FB234830B 41 | E413D22E-577B-406D-8B36-BFC3FFD666C6 42 | D2807B34-865C-4302-8695-40B92AD89F29 43 | 50A4C9CE-08BB-4934-8742-173D069D6124 44 | 327FD992-A355-41EF-BFF7-2C6C9834D80B 45 | D24A93BA-A700-4DD7-BD47-520DF4ECB21C 46 | 2C7AD6A1-E62C-4309-86AC-3925788E548F 47 | CF4ADBEE-A729-4E42-817E-FA73BCD9EC8F 48 | 016835BD-9D1C-452F-8B57-2D73F1671BF0 49 | C19B5310-B6FE-4EEF-91C5-7C95E0AEF5EB 50 | EADE6066-29BC-4D7C-B1AE-0F9632D08E07 51 | 6548DE73-1EBB-48B9-8C61-DEC7B36068C6 52 | FAE1F922-F493-4468-ADDD-657D054A3553 53 | FC43AF81-7C64-4ABC-A76E-C4EEA2C4028F 54 | 84E592C9-98A7-47CA-A6C4-D1DCA13A4F38 55 | 2DDF72AA-51DC-4430-945C-DC532C0CE790 56 | 32AA1855-A76E-4958-9839-AA57FF3C3A72 57 | 5E4F62E5-8AA5-48BA-B593-8512E8495F75 58 | EF64D81A-B2DB-439C-AC18-67D228B3B900 59 | 5392DE45-2253-48D4-A61A-FBB8906A87A6 60 | 20FE89AE-D53C-4524-8DF0-1800F0F22050 61 | 3891A44B-658D-4501-AFFB-09B71C46FB18 62 | 9B1B5759-CDCA-4E7C-852A-D919A498491C 63 | 5690EEC3-8A23-4C2D-A659-9D6B6EB37DAD 64 | E02FAC5D-B131-4F6A-AF53-7BCD273CE86F 65 | AA24F720-D060-46E1-A70A-308CBD5941D8 66 | 762B9437-A549-4DEF-8A28-4926A8C2ADFB 67 | A46B9F2E-1BAE-4FC2-95C8-5858F3991998 68 | 4844B985-D53A-4BBF-A051-8A77F1C094B5 69 | F4B009CE-4D03-47B4-93F1-EB7FA1127F0E 70 | 71 | uuid 72 | 28E62053-907B-4C39-A333-859382386771 73 | 74 | 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Textmate Bundle for Buster.JS 2 | 3 | ## Commands 4 | 5 | * cmd+shift+r => Run all tests 6 | * cmd+r => Run current test file 7 | 8 | ## Common snippets 9 | 10 | * tc => new testCase (one for node, browser and node+browser) 11 | * tt => additional test 12 | * cx => nested context 13 | * su => setup method 14 | * td => teardown method 15 | 16 | Assert and refute snippets follow a common pattern. They start with `as` or `re` 17 | the a mnemonic shortcut. Most are simply the 'initials' of the method name, but 18 | the best shortcuts are saved for the most common assertions. 19 | 20 | ase - assert.equals 21 | asm - assert.match 22 | 23 | asc1 - assert.calledOnce 24 | asc2 - assert.calledTwice 25 | asc3 - assert.calledThrice 26 | ascw - assert.calledWith 27 | ascn - assert.className 28 | astn - assert.tagName 29 | asx - assert.exception 30 | asd - assert.defined 31 | asid - assert.inDelta 32 | asif - assert.isFunction 33 | asin - assert.isNull 34 | asio - assert.isObject 35 | 36 | ass - assert.same 37 | asto - assert.typeOf 38 | ast - assert.threw 39 | asat - assert.alwaysThrew 40 | asc - assert.called 41 | ascc - assert.callCount 42 | asco - assert.callOrder 43 | asco - assert.calledOn 44 | asaco - assert.alwaysCalledOn 45 | asacw - assert.alwaysCalledWith 46 | asacwe - assert.alwaysCalledWithExactly 47 | ascwe - assert.calledWithExactly 48 | 49 | Refute mirrors assert exactly, except that they start with `re` instead of 50 | `as`. It's the beauty of symmetry. 51 | 52 | ## Prerequisites 53 | 54 | * Buster.js has to be installed. 55 | * The shell script for the `Run all tests` command has to find node in PATH. To ensure this either update your `~/.MacOSX/environment.plist` or set the PATH variable in TextMates Preferences/Advanced/Shell Variables accordingly. See the [TextMate manual](http://manual.macromates.com/en/shell_commands#search_path) for details. 56 | * The shell script for the `Run all tests` command requires `buster/node_modules/buster-test-cli`. To ensure this add a Shell Variable `NODE_PATH` referencing your node modules in TextMates Preferences/Advanced/Shell Variables, e.g. to `/usr/local/lib/node_modules`. 57 | 58 | ## Installation 59 | 60 | mkdir -p ~/Library/Application\ Support/TextMate/Bundles/ 61 | cd ~/Library/Application\ Support/TextMate/Bundles 62 | git clone git://github.com/magnars/buster.tmbundle.git "Buster.tmbundle" 63 | 64 | Then reload your bundles: 65 | 66 | osascript -e 'tell app "TextMate" to reload bundles' 67 | 68 | Alternately, in TextMate, from your drop down menu, select Bundles -> Bundle Editor -> Reload Bundles. 69 | 70 | ## Credits 71 | 72 | The Buster.JS TM Bundle is currently authored by Magnar Sveen. Contributors and co-maintainers are welcome. 73 | 74 | * **Magnar Sveen** - Author/Main contributor 75 | * **Stefan Scheidt** - Improved support for multiple platforms 76 | * **Thomas Pickert** - Added cmd+r and some more snippets 77 | 78 | ## License 79 | 80 | Copyright (c) 2011 Magnar Sveen, Norway 81 | 82 | Permission is hereby granted, free of charge, to any person obtaining a copy 83 | of this software and associated documentation files (the "Software"), to deal 84 | in the Software without restriction, including without limitation the rights 85 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 86 | copies of the Software, and to permit persons to whom the Software is 87 | furnished to do so, subject to the following conditions: 88 | 89 | The above copyright notice and this permission notice shall be included in 90 | all copies or substantial portions of the Software. 91 | 92 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 93 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 94 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 95 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 96 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 97 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 98 | THE SOFTWARE. 99 | -------------------------------------------------------------------------------- /Commands/Run current test file.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env node 9 | 10 | process.chdir(process.env.TM_PROJECT_DIRECTORY); 11 | 12 | var 13 | testCli = require("buster/node_modules/buster-test-cli").cli.test.create(), 14 | configFile = testCli.findConfigFile(), 15 | config = require("buster/node_modules/buster-test-cli/node_modules/buster-configuration").create(), 16 | minimatch = require("buster/node_modules/buster-test-cli/node_modules/buster-cli/node_modules/minimatch/"); 17 | 18 | config.loadFile(configFile); 19 | 20 | /* 21 | * Iterates over all groups and all test patterns within those groups to find a matching 22 | * test pattern for the given filePath 23 | * 24 | * @param path to the file that is to be tested 25 | * @param configuration groups 26 | * 27 | * @return true if match is found, false otherwise 28 | */ 29 | function matchesAnyTestPattern(filePath, groups) { 30 | var 31 | group, 32 | i, j, l, m; 33 | 34 | for (i = 0, l = groups.length; i < l; i += 1) { 35 | for (j = 0, group = groups[i], m = group.tests.length; j < m; j += 1) { 36 | 37 | // test filePath against test pattern (prepended with path to project root) 38 | if (minimatch(filePath, group.rootPath + "/" + group.tests[j])) { 39 | return true; 40 | } 41 | 42 | } 43 | } 44 | 45 | // no match found for any of the patterns 46 | return false; 47 | } 48 | 49 | /* 50 | * Assumes that filePath is a source file, and tries to guess substitutions 51 | * for each group configuration to find the corresponding test file 52 | * 53 | * @param path to the source file 54 | * @param configuration groups 55 | * 56 | * @return the substituted file path if match is found, false otherwise 57 | */ 58 | function matchesAnyTestPatternWithSubstitutions(filePath, groups) { 59 | var 60 | group, 61 | i, j, k, l, m, o, 62 | substitutedFilePath, 63 | testMatches, 64 | sourceMatches, 65 | regEx = /(?:([^/*]+)(?=\/|$))/g; 66 | 67 | for (i = 0, l = groups.length; i < l; i += 1) { 68 | group = groups[i]; 69 | 70 | // we make some assumptions here to guess the test file 71 | // to have any chance of success, the number of sources and tests patterns have to be equal 72 | if (group.tests.length !== group.sources.length) { 73 | continue; 74 | } 75 | 76 | for (j = 0, m = group.tests.length; j < m; j += 1) { 77 | 78 | testMatches = group.tests[j].match(regEx); 79 | sourceMatches = group.sources[j].match(regEx); 80 | 81 | // if the number of matches in the test and source file paths are not equal 82 | // we have no chance to success, so we skip 83 | if (null === testMatches || null === sourceMatches || testMatches.length !== sourceMatches.length) { 84 | continue; 85 | } 86 | 87 | substitutedFilePath = filePath; 88 | 89 | // replace corresponding path fragments from sourceMatches to testMatches 90 | for (k = 0, o = testMatches.length; k < o; k += 1) { 91 | substitutedFilePath = substitutedFilePath.replace(sourceMatches[k], testMatches[k]); 92 | } 93 | 94 | // test filePath against test pattern (prepended with path to project root) 95 | if (minimatch(substitutedFilePath, group.rootPath + "/" + group.tests[j])) { 96 | return substitutedFilePath; 97 | } 98 | 99 | } 100 | } 101 | 102 | // no match found for any of the patterns 103 | return false; 104 | } 105 | 106 | 107 | // if the current file matches a pattern for a test file, run the test client with the current file 108 | if (matchesAnyTestPattern(process.env.TM_FILEPATH, config.groups)) { 109 | 110 | // run current file as test 111 | testCli.run(["-r", "html", "-t", process.env.TM_FILEPATH]); 112 | 113 | // we're done, stop execution 114 | return; 115 | } 116 | 117 | 118 | // try if we can match a test pattern by substituting parts of the file path 119 | // with parts from the respective test pattern 120 | if (false !== (substitutedFilePath = matchesAnyTestPatternWithSubstitutions(process.env.TM_FILEPATH, config.groups))) { 121 | 122 | // run current file as test 123 | testCli.run(["-r", "html", "-t", substitutedFilePath]); 124 | 125 | // we're done, stop execution 126 | return; 127 | } 128 | 129 | require("util").print("<h1>No test file found</h1>" 130 | + "<p>We have tried our best to guess the path to the test file based on your configuration.</p>" 131 | + "<p>If you believe the path to the test file could have been reasonably guessed, feel free to open an issue at <a href=\"https://github.com/magnars/buster.tmbundle\">Buster.tmbundle@Github</a> and give us a hint.</p>"); 132 | 133 | input 134 | none 135 | keyEquivalent 136 | @r 137 | name 138 | Run current test file 139 | output 140 | showAsHTML 141 | scope 142 | source.js 143 | uuid 144 | 0319EB36-7FE7-4E49-B4D5-6C502B30BFC2 145 | 146 | 147 | --------------------------------------------------------------------------------