Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0fae072

Browse files
committed
Refactor extensions.ts
1 parent e056169 commit 0fae072

File tree

5 files changed

+285
-355
lines changed

5 files changed

+285
-355
lines changed

__tests__/extensions.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
import * as extensions from '../src/extensions';
22

33
describe('Extension tests', () => {
4-
it('checking getXdebugVersion', async () => {
5-
expect(await extensions.getXdebugVersion('5.3')).toContain('2.2.7');
6-
expect(await extensions.getXdebugVersion('5.4')).toContain('2.4.1');
7-
expect(await extensions.getXdebugVersion('5.5')).toContain('2.5.5');
8-
expect(await extensions.getXdebugVersion('5.6')).toContain('2.5.5');
9-
expect(await extensions.getXdebugVersion('7.0')).toContain('2.7.2');
10-
expect(await extensions.getXdebugVersion('7.2')).toContain('2.9.6');
11-
});
12-
it('checking getUnsupportedLog', async () => {
13-
expect(await extensions.getUnsupportedLog('ext', '5.6', 'linux')).toContain(
14-
'add_log "$cross" "ext" "ext is not supported on PHP 5.6"'
15-
);
16-
});
17-
184
it('checking addExtensionOnWindows', async () => {
195
let win32: string = await extensions.addExtension(
206
'Xdebug, pcov, sqlite, :intl, phalcon4, ioncube, oci8, pdo_oci, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2',

__tests__/utils.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,23 @@ describe('Utils tests', () => {
167167
'Platform fedora is not supported'
168168
);
169169
});
170+
171+
it('checking getXdebugVersion', async () => {
172+
expect(await utils.getXdebugVersion('5.3')).toContain('2.2.7');
173+
expect(await utils.getXdebugVersion('5.4')).toContain('2.4.1');
174+
expect(await utils.getXdebugVersion('5.5')).toContain('2.5.5');
175+
expect(await utils.getXdebugVersion('5.6')).toContain('2.5.5');
176+
expect(await utils.getXdebugVersion('7.0')).toContain('2.7.2');
177+
expect(await utils.getXdebugVersion('7.2')).toContain('2.9.6');
178+
});
179+
180+
it('checking getUnsupportedLog', async () => {
181+
expect(await utils.getUnsupportedLog('ext', '5.6', 'linux')).toContain(
182+
'add_log "$cross" "ext" "ext is not supported on PHP 5.6"'
183+
);
184+
});
185+
186+
it('checking joins', async () => {
187+
expect(await utils.joins('a', 'b', 'c')).toBe('a b c');
188+
});
170189
});

0 commit comments

Comments
 (0)