Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Added TextMate bundle and `make tm`. Closes #20

Tj Holowaychuk908ea48ea473
diff --git a/Makefile b/Makefile
index fcd66afe..d03de929 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
REPORTER = dot
+TM_DEST = ~/Library/Application\ Support/TextMate/Bundles
+TM_BUNDLE = JavaScript\ mocha.tmbundle
test: test-unit
@@ -33,4 +35,7 @@ test-grep:
--grep fast \
test/misc/grep
-.PHONY: test test-all test-bdd test-tdd test-exports test-unit test-grep
\ No newline at end of file
+tm:
+ cp -fr editors/$(TM_BUNDLE) $(TM_DEST)/$(TM_BUNDLE)
+
+.PHONY: test test-all test-bdd test-tdd test-exports test-unit test-grep tm
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index fedb36ee..2f0bf2fc 100644
--- a/Readme.md
+++ b/Readme.md
@@ -25,6 +25,7 @@
- mocha.opts file support
- `mocha-debug(1)` for node debugger support
- detects multiple calls to `done()`
+ - TextMate bundle
- use any assertion library you want ([should](http://github.com/visionmedia/should.js), `assert`, etc)
- extensible reporting
- dot matrix
@@ -264,6 +265,12 @@ test:
.PHONY: test
```
+## TextMate Bundle
+
+ To install the TextMate bundle run:
+
+ $ make tm
+
## Running tests
Run mocha tests:
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet
new file mode 100644
index 00000000..e76cae13
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>afterEach(function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - after each</string>
+ <key>tabTrigger</key>
+ <string>ae</string>
+ <key>uuid</key>
+ <string>7B4DA8F4-2064-468B-B252-054148419B4B</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet
new file mode 100644
index 00000000..f1a67aa1
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>after(function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - after</string>
+ <key>tabTrigger</key>
+ <string>a</string>
+ <key>uuid</key>
+ <string>A49A87F9-399E-4D74-A489-C535BB06D487</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet
new file mode 100644
index 00000000..f8442fa5
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>beforeEach(function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - before each</string>
+ <key>tabTrigger</key>
+ <string>be</string>
+ <key>uuid</key>
+ <string>7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet
new file mode 100644
index 00000000..5c7e40fb
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>before(function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - before</string>
+ <key>tabTrigger</key>
+ <string>b</string>
+ <key>uuid</key>
+ <string>DF6F1F42-F80A-4A24-AF78-376F19070C4C</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet
new file mode 100644
index 00000000..8cd3fb17
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>it('should $1', function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - it</string>
+ <key>tabTrigger</key>
+ <string>it</string>
+ <key>uuid</key>
+ <string>591AE071-95E4-4E1E-B0F3-A7DAF41595EE</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet b/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet
new file mode 100644
index 00000000..46fd7206
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/Snippets/untitled.tmSnippet
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>describe('$1', function(){
+ $0
+})</string>
+ <key>name</key>
+ <string>bdd - describe</string>
+ <key>tabTrigger</key>
+ <string>des</string>
+ <key>uuid</key>
+ <string>4AA1FB50-9BB9-400E-A140-D61C39BDFDF5</string>
+</dict>
+</plist>
diff --git a/editors/JavaScript mocha.tmbundle/info.plist b/editors/JavaScript mocha.tmbundle/info.plist
new file mode 100644
index 00000000..16f6587a
--- /dev/null
+++ b/editors/JavaScript mocha.tmbundle/info.plist
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>name</key>
+ <string>JavaScript mocha</string>
+ <key>ordering</key>
+ <array>
+ <string>4AA1FB50-9BB9-400E-A140-D61C39BDFDF5</string>
+ <string>591AE071-95E4-4E1E-B0F3-A7DAF41595EE</string>
+ <string>DF6F1F42-F80A-4A24-AF78-376F19070C4C</string>
+ <string>A49A87F9-399E-4D74-A489-C535BB06D487</string>
+ <string>7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E</string>
+ <string>7B4DA8F4-2064-468B-B252-054148419B4B</string>
+ </array>
+ <key>uuid</key>
+ <string>094ACE33-0C0E-422A-B3F7-5B919F5B1239</string>
+</dict>
+</plist>