From 3d7539477c5d729d20998f4284e071868b05cc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nald=20Casagraude?= Date: Wed, 24 Feb 2016 02:20:51 +0100 Subject: [PATCH 1/5] Fix snippet file name --- ...-hook copy.sublime-snippet => after-each-hook.sublime-snippet} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename snippets/{after-each-hook copy.sublime-snippet => after-each-hook.sublime-snippet} (100%) diff --git a/snippets/after-each-hook copy.sublime-snippet b/snippets/after-each-hook.sublime-snippet similarity index 100% rename from snippets/after-each-hook copy.sublime-snippet rename to snippets/after-each-hook.sublime-snippet From 8f3005762697b73f69335a44717a63b245f75ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nald=20Casagraude?= Date: Wed, 24 Feb 2016 03:15:07 +0100 Subject: [PATCH 2/5] Guess module name from function name --- snippets/ava.sublime-snippet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ava.sublime-snippet b/snippets/ava.sublime-snippet index e5a9f86..e720bb6 100644 --- a/snippets/ava.sublime-snippet +++ b/snippets/ava.sublime-snippet @@ -1,7 +1,7 @@ { t.is($1(), '$4'); From 58b4b7f29d3e4513f4baa0078ff7aa3def9f8ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nald=20Casagraude?= Date: Wed, 24 Feb 2016 03:17:39 +0100 Subject: [PATCH 3/5] Make test title optional --- snippets/ava.sublime-snippet | 2 +- snippets/test-async.sublime-snippet | 2 +- snippets/test-cb.sublime-snippet | 2 +- snippets/test-serial.sublime-snippet | 2 +- snippets/test.sublime-snippet | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/ava.sublime-snippet b/snippets/ava.sublime-snippet index e720bb6..0cb5837 100644 --- a/snippets/ava.sublime-snippet +++ b/snippets/ava.sublime-snippet @@ -3,7 +3,7 @@ import test from 'ava'; import $1 from ${2:'${1/([A-Z])/-\l$1/g}'}; -test('${3:title}', t => { +test(${3/(.+)|.*/?1:'/}${3:title}${3/(.+)|.*/?1:', /}t => { t.is($1(), '$4'); }); ]]> diff --git a/snippets/test-async.sublime-snippet b/snippets/test-async.sublime-snippet index bf635e1..a27dd53 100644 --- a/snippets/test-async.sublime-snippet +++ b/snippets/test-async.sublime-snippet @@ -1,6 +1,6 @@ { +test(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}async t => { $2 }); ]]> diff --git a/snippets/test-cb.sublime-snippet b/snippets/test-cb.sublime-snippet index e46df40..e3c0298 100644 --- a/snippets/test-cb.sublime-snippet +++ b/snippets/test-cb.sublime-snippet @@ -1,6 +1,6 @@ { +test.cb(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}t => { $2 }); ]]> diff --git a/snippets/test-serial.sublime-snippet b/snippets/test-serial.sublime-snippet index 4f20bf3..72a1b60 100644 --- a/snippets/test-serial.sublime-snippet +++ b/snippets/test-serial.sublime-snippet @@ -1,6 +1,6 @@ { +test.serial(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}, t => { $2 }); ]]> diff --git a/snippets/test.sublime-snippet b/snippets/test.sublime-snippet index a1d9d87..4ba92b8 100644 --- a/snippets/test.sublime-snippet +++ b/snippets/test.sublime-snippet @@ -1,6 +1,6 @@ { +test(${1/(.+)|.*/?1:'/}${1:title}${1/(.+)|.*/?1:', /}t => { $2 }); ]]> From a27b328192fb26376e43dfe5fd6e525d4c1960e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nald=20Casagraude?= Date: Sat, 5 Mar 2016 23:44:37 +0100 Subject: [PATCH 4/5] Improve regex performance by removing unecessary patterns and captures --- snippets/ava.sublime-snippet | 2 +- snippets/test-async.sublime-snippet | 2 +- snippets/test-cb.sublime-snippet | 2 +- snippets/test-serial.sublime-snippet | 2 +- snippets/test.sublime-snippet | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/ava.sublime-snippet b/snippets/ava.sublime-snippet index 0cb5837..96709c1 100644 --- a/snippets/ava.sublime-snippet +++ b/snippets/ava.sublime-snippet @@ -3,7 +3,7 @@ import test from 'ava'; import $1 from ${2:'${1/([A-Z])/-\l$1/g}'}; -test(${3/(.+)|.*/?1:'/}${3:title}${3/(.+)|.*/?1:', /}t => { +test(${3/.+/'/}${3:title}${3/.+/', /}t => { t.is($1(), '$4'); }); ]]> diff --git a/snippets/test-async.sublime-snippet b/snippets/test-async.sublime-snippet index a27dd53..76aeffb 100644 --- a/snippets/test-async.sublime-snippet +++ b/snippets/test-async.sublime-snippet @@ -1,6 +1,6 @@ { +test(${1/.+/'/}${1:title}${1/.+/', /}async t => { $2 }); ]]> diff --git a/snippets/test-cb.sublime-snippet b/snippets/test-cb.sublime-snippet index e3c0298..d1a4b98 100644 --- a/snippets/test-cb.sublime-snippet +++ b/snippets/test-cb.sublime-snippet @@ -1,6 +1,6 @@ { +test.cb(${1/.+/'/}${1:title}${1/.+/', /}t => { $2 }); ]]> diff --git a/snippets/test-serial.sublime-snippet b/snippets/test-serial.sublime-snippet index 72a1b60..58a46ea 100644 --- a/snippets/test-serial.sublime-snippet +++ b/snippets/test-serial.sublime-snippet @@ -1,6 +1,6 @@ { +test.serial(${1/.+/'/}${1:title}${1/.+/', /}, t => { $2 }); ]]> diff --git a/snippets/test.sublime-snippet b/snippets/test.sublime-snippet index 4ba92b8..4817069 100644 --- a/snippets/test.sublime-snippet +++ b/snippets/test.sublime-snippet @@ -1,6 +1,6 @@ { +test(${1/.+/'/}${1:title}${1/.+/', /}t => { $2 }); ]]> From ae6a0058b10273b23d254ddedcfa213447fad641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9nald=20Casagraude?= Date: Sat, 5 Mar 2016 23:46:43 +0100 Subject: [PATCH 5/5] Fix typo --- snippets/test-serial.sublime-snippet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/test-serial.sublime-snippet b/snippets/test-serial.sublime-snippet index 58a46ea..7022474 100644 --- a/snippets/test-serial.sublime-snippet +++ b/snippets/test-serial.sublime-snippet @@ -1,6 +1,6 @@ { +test.serial(${1/.+/'/}${1:title}${1/.+/', /}t => { $2 }); ]]>