Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed test to import js instead of coffee.

  • Loading branch information...
commit 6c18636625d42f6d46574dfb105dbf3919520fa5 1 parent ae6295b
seb vincent authored
3  Cakefile
@@ -33,11 +33,10 @@ task 'prepare:test', 'Import tests from wd and disable test for non-implemented
33 33
     (done) -> u.exec "mkdir -p #{targetDir}", done
34 34
     (done) -> u.exec "rm -rf #{targetDir}/*", done
35 35
     (done) -> u.exec "cp -r #{sourceDir}/* #{targetDir}/", done
36  
-    (done) -> u.exec "rm -f #{targetDir}/*.js", done
37 36
     (done) -> u.exec "rm -f #{targetDir}/*test-base.coffee", done
38 37
     (done) -> 
39 38
       cp.execFile 'find', [ sourceDir  ] , (err, stdout, stderr) ->
40  
-        files = (stdout.split '\n').filter( (name) -> name.match /.+-test\-base\.coffee/ )
  39
+        files = (stdout.split '\n').filter( (name) -> name.match /.+-test\-base\.js/ )
41 40
         async.forEachSeries files, (f, done) ->
42 41
           filename = f.replace "#{sourceDir}/" , '' 
43 42
           prepareTest sourceDir, targetDir, filename, done 
2  test/mocha.opts
@@ -3,3 +3,5 @@
3 3
 --reporter spec
4 4
 -t 60000
5 5
 --bail
  6
+-g DISABLED
  7
+-i
10  tools/prepare-tests.coffee
@@ -20,7 +20,7 @@ disabledTests =
20 20
     '.*'
21 21
   ]
22 22
 module.exports = (sourceDir, targetDir, filename , done) ->
23  
-  fileKey = filename.replace '-base.coffee', ''
  23
+  fileKey = filename.replace '-base.js', ''
24 24
   orig = null
25 25
   target = null
26 26
   async.series [
@@ -36,10 +36,12 @@ module.exports = (sourceDir, targetDir, filename , done) ->
36 36
       disabledTestsForFile = disabledTests[fileKey] or []
37 37
       async.forEachSeries orig.split('\n'), (line, done) ->                
38 38
         async.forEachSeries disabledTestsForFile, (d, done) ->
39  
-          rx = new RegExp "describe \"*#{d}\"*"
  39
+          rx = new RegExp "describe\\\(\"#{d}.*"
40 40
           if line.match rx
41  
-            line = line.replace "describe", "if false then describe"
42  
-            line = "#{line} # disabled be prepareTests"
  41
+            line = line.replace "describe(\"", "describe(\"<DISABLED>"
  42
+          rx = new RegExp "describe\\\(#{d}.*"
  43
+          if line.match rx
  44
+            line = line.replace "describe(", "describe(\"<DISABLED>\" + "
43 45
           done null
44 46
         , (err) ->
45 47
           unless err?

0 notes on commit 6c18636

Please sign in to comment.
Something went wrong with that request. Please try again.