quilltap 4.9.0-dev.65 → 4.9.0-dev.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
* COMPREPLY back). Zsh's completion system can only be driven from inside a
|
|
12
12
|
* completion widget, so its template is checked structurally instead.
|
|
13
13
|
*
|
|
14
|
+
* The one zsh assertion that needs a real `zsh` — the parse check — skips
|
|
15
|
+
* where the shell isn't installed. Bash is on every machine that runs this
|
|
16
|
+
* suite; zsh is not (GitHub's ubuntu runners ship without it, which is why
|
|
17
|
+
* CI's test job installs it before calling jest).
|
|
18
|
+
*
|
|
14
19
|
* @jest-environment node
|
|
15
20
|
*/
|
|
16
21
|
|
|
@@ -46,6 +51,16 @@ function makeStubBin() {
|
|
|
46
51
|
const STUB_BIN = makeStubBin();
|
|
47
52
|
afterAll(() => fs.rmSync(STUB_BIN, { recursive: true, force: true }));
|
|
48
53
|
|
|
54
|
+
/** Whether a real `zsh` exists to hand a script to. */
|
|
55
|
+
const HAS_ZSH = (() => {
|
|
56
|
+
try {
|
|
57
|
+
execFileSync('zsh', ['-c', ':'], { stdio: 'ignore' });
|
|
58
|
+
return true;
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
})();
|
|
63
|
+
|
|
49
64
|
/**
|
|
50
65
|
* Complete `line` with the bash template and return the candidate list.
|
|
51
66
|
* A trailing space means "start a new word", exactly as at a real prompt.
|
|
@@ -138,7 +153,8 @@ describe('zsh completion parses positions instead of counting words', () => {
|
|
|
138
153
|
expect(dispatchers.length).toBeGreaterThanOrEqual(6);
|
|
139
154
|
});
|
|
140
155
|
|
|
141
|
-
|
|
156
|
+
// Needs the shell itself; skipped rather than failed where it is absent.
|
|
157
|
+
(HAS_ZSH ? it : it.skip)('is syntactically valid', () => {
|
|
142
158
|
const file = path.join(STUB_BIN, '_quilltap');
|
|
143
159
|
fs.writeFileSync(file, tpl);
|
|
144
160
|
expect(() => execFileSync('zsh', ['-n', file], { stdio: 'pipe' })).not.toThrow();
|