(subject, predicate)
| 10 | if (name != null) spec[name] = ctx = {} |
| 11 | |
| 12 | function o(subject, predicate) { |
| 13 | if (predicate === undefined) { |
| 14 | if (!isRunning()) throw new Error("Assertions should not occur outside test definitions") |
| 15 | return new Assert(subject) |
| 16 | } else { |
| 17 | if (isRunning()) throw new Error("Test definitions and hooks shouldn't be nested. To group tests use `o.spec()`") |
| 18 | subject = String(subject) |
| 19 | if (subject.charCodeAt(0) === 1) throw new Error("test names starting with '\\x01' are reserved for internal use") |
| 20 | ctx[unique(subject)] = new Task(predicate, ensureStackTrace(new Error)) |
| 21 | } |
| 22 | } |
| 23 | o.before = hook("\x01before") |
| 24 | o.after = hook("\x01after") |
| 25 | o.beforeEach = hook("\x01beforeEach") |
no test coverage detected