summaryrefslogtreecommitdiffstats
path: root/node_modules/buffer/bin/test.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/buffer/bin/test.js
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/buffer/bin/test.js')
-rw-r--r--node_modules/buffer/bin/test.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/node_modules/buffer/bin/test.js b/node_modules/buffer/bin/test.js
new file mode 100644
index 0000000..5a86f1b
--- /dev/null
+++ b/node_modules/buffer/bin/test.js
@@ -0,0 +1,41 @@
+#!/usr/bin/env node
+
+var cp = require('child_process')
+var fs = require('fs')
+var path = require('path')
+
+var shouldRunBrowserTests = !process.env.TRAVIS_PULL_REQUEST ||
+ process.env.TRAVIS_PULL_REQUEST === 'false'
+
+var node = cp.spawn('npm', ['run', 'test-node'], { stdio: 'inherit' })
+node.on('close', function (code) {
+ if (code === 0 && shouldRunBrowserTests) {
+ runBrowserTests()
+ } else {
+ process.exit(code)
+ }
+})
+
+function runBrowserTests () {
+ var zuulYmlPath = path.join(__dirname, '..', '.zuul.yml')
+
+ writeES5ZuulYml()
+ cp.spawn('npm', ['run', 'test-browser-es5'], { stdio: 'inherit' })
+ .on('close', function (code) {
+ if (code !== 0) process.exit(code)
+ writeES6ZuulYml()
+ cp.spawn('npm', ['run', 'test-browser-es6'], { stdio: 'inherit' })
+ .on('close', function (code) {
+ process.exit(code)
+ })
+ })
+
+ function writeES5ZuulYml () {
+ fs.writeFileSync(zuulYmlPath, fs.readFileSync(path.join(__dirname, 'zuul-es5.yml')))
+ }
+
+ function writeES6ZuulYml () {
+ fs.writeFileSync(zuulYmlPath, fs.readFileSync(path.join(__dirname, 'zuul-es6.yml')))
+ }
+}
+