1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | function assertContent(p, path, assertion, err) {
|
13 | return p.findFile(path)
|
14 | .then(f => f.getContent()
|
15 | .then(content => assertion(content) ?
|
16 | Promise.resolve(p) :
|
17 | Promise.reject(err ? err : `Assertion failed about project ${p.name}: ${assertion}`)));
|
18 | }
|
19 | exports.assertContent = assertContent;
|
20 | function assertContentIncludes(p, path, what) {
|
21 | return assertContent(p, path, content => content.includes(what), `File at [${path}] does not contain [${what}]`);
|
22 | }
|
23 | exports.assertContentIncludes = assertContentIncludes;
|
24 | function assertFileExists(p, path) {
|
25 | return assertContent(p, path, content => true, `File at [${path}] does not exist`);
|
26 | }
|
27 | exports.assertFileExists = assertFileExists;
|
28 |
|
\ | No newline at end of file |