[ospec/bin] Back to ES5 (and complimentary cleanup), fix #2160
This commit is contained in:
parent
010d8daae9
commit
562d680981
2 changed files with 24 additions and 24 deletions
|
|
@ -1,16 +1,16 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
"use strict"
|
"use strict"
|
||||||
|
|
||||||
const o = require("../ospec")
|
var o = require("../ospec")
|
||||||
const path = require("path")
|
var path = require("path")
|
||||||
const glob = require("glob")
|
var glob = require("glob")
|
||||||
|
|
||||||
|
|
||||||
const parseArgs = (argv) => {
|
function parseArgs(argv) {
|
||||||
argv = ["--globs"].concat(argv.slice(2))
|
argv = ["--globs"].concat(argv.slice(2))
|
||||||
const args = {}
|
var args = {}
|
||||||
let name
|
var name
|
||||||
argv.forEach((arg) => {
|
argv.forEach(function(arg) {
|
||||||
if (/^--/.test(arg)) {
|
if (/^--/.test(arg)) {
|
||||||
name = arg.substr(2)
|
name = arg.substr(2)
|
||||||
args[name] = args[name] || []
|
args[name] = args[name] || []
|
||||||
|
|
@ -22,26 +22,21 @@ const parseArgs = (argv) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const args = parseArgs(process.argv)
|
var args = parseArgs(process.argv)
|
||||||
const globList = args.globs && args.globs.length ? args.globs : ["**/tests/**/*.js"]
|
var globList = args.globs && args.globs.length ? args.globs : ["**/tests/**/*.js"]
|
||||||
const ignore = ["**/node_modules/**"].concat(args.ignore||[])
|
var ignore = ["**/node_modules/**"].concat(args.ignore||[])
|
||||||
const cwd = process.cwd()
|
var cwd = process.cwd()
|
||||||
|
|
||||||
args.require && args.require.forEach(function(module) {
|
args.require && args.require.forEach(function(module) {
|
||||||
module && require(require.resolve(module, { basedir: cwd }))
|
module && require(require.resolve(module, { basedir: cwd }))
|
||||||
})
|
})
|
||||||
|
|
||||||
let pending = globList.length
|
var pending = globList.length
|
||||||
globList.forEach((globPattern) => {
|
globList.forEach(function(globPattern) {
|
||||||
glob(globPattern, {ignore})
|
glob(globPattern, {ignore: ignore})
|
||||||
.on("match", (fileName) => { require(path.join(cwd, fileName)) }) // eslint-disable-line global-require
|
.on("match", function(fileName) { require(path.join(cwd, fileName)) }) // eslint-disable-line global-require
|
||||||
.on("error", (e) => console.error(e))
|
.on("error", function(e) { console.error(e) })
|
||||||
.on("end", () => {
|
.on("end", function() { if (--pending === 0) o.run()})
|
||||||
pending--
|
|
||||||
if (pending === 0) {
|
|
||||||
o.run()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on("unhandledRejection", (e) => { console.log("Uncaught (in promise) " + e.stack) })
|
process.on("unhandledRejection", function(e) { console.error("Uncaught (in promise) " + e.stack) })
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,14 @@
|
||||||
|
|
||||||
## Upcoming...
|
## Upcoming...
|
||||||
<!-- Add new lines here. Version number will be decided later -->
|
<!-- Add new lines here. Version number will be decided later -->
|
||||||
- Pinpoint the `o.only()` call site
|
### Features
|
||||||
|
>>>>>>> [ospec/bin] Back to ES5 (and complimentary cleanup), fix #2160
|
||||||
|
- Pinpoint the `o.only()` call site ([#2157](https://github.com/MithrilJS/mithril.js/pull/2157))
|
||||||
- Improved wording, spacing and color-coding of report messages and errors ([#2147](https://github.com/MithrilJS/mithril.js/pull/2147), [@maranomynet](https://github.com/maranomynet))
|
- Improved wording, spacing and color-coding of report messages and errors ([#2147](https://github.com/MithrilJS/mithril.js/pull/2147), [@maranomynet](https://github.com/maranomynet))
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
- Convert the exectuable back to plain ES5 [#2160](https://github.com/MithrilJS/mithril.js/issues/2160) ([#2161](https://github.com/MithrilJS/mithril.js/pull/2161))
|
||||||
|
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
_2018-05-09_
|
_2018-05-09_
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue