]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / cmd-shim / test / 00-setup.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js
new file mode 100644 (file)
index 0000000..04ec2b2
--- /dev/null
@@ -0,0 +1,34 @@
+var test = require('tap').test
+var mkdirp = require('mkdirp')
+var fs = require('fs')
+var path = require('path')
+var fixtures = path.resolve(__dirname, 'fixtures')
+
+var froms = {
+  'from.exe': 'exe',
+  'from.env': '#!/usr/bin/env node\nconsole.log(/hi/)\n',
+  'from.env.args': '#!/usr/bin/env node --expose_gc\ngc()\n',
+  'from.sh': '#!/usr/bin/sh\necho hi\n',
+  'from.sh.args': '#!/usr/bin/sh -x\necho hi\n'
+}
+
+var cmdShim = require('../')
+
+test('create fixture', function (t) {
+  mkdirp(fixtures, function (er) {
+    if (er)
+      throw er
+    t.pass('made dir')
+    Object.keys(froms).forEach(function (f) {
+      t.test('write ' + f, function (t) {
+        fs.writeFile(path.resolve(fixtures, f), froms[f], function (er) {
+          if (er)
+            throw er
+          t.pass('wrote ' + f)
+          t.end()
+        })
+      })
+    })
+    t.end()
+  })
+})