lib/tad-ignore-mode.js
raw| 1 | "use strict"; |
| 2 | |
| 3 | var findRoot = require("next/module/find-package-root") |
| 4 | , resolve = require("path").resolve; |
| 5 | |
| 6 | var isRoot; |
| 7 | |
| 8 | require("fs2/lib/ignore-modes").tad = module.exports = { |
| 9 | filename: ".testignore", |
| 10 | isRoot: (isRoot = function (path) { |
| 11 | var promise = findRoot(resolve(path, "_find-that-root_"))(function (projectPath) { |
| 12 | return projectPath === path; |
| 13 | }); |
| 14 | promise.path = path; |
| 15 | return promise; |
| 16 | }), |
| 17 | isRootWatcher: isRoot |
| 18 | }; |
| 19 | isRoot.returnsPromise = true; |