chore(typedoc-plugin-appium): wrap all tests in same suite title
Everything else here is whitespace.
Using this pattern helps with some 3p tools to navigate tests in the monorepo, as they can easily be grouped by the top-level suite title
MODIFY
packages/typedoc-plugin-appium/test/unit/converter/builtin-external-driver.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/builtin-external-driver.spec.ts
@@ -9,7 +9,7 @@ import {
} from '../../../lib/converter';
import {AppiumPluginLogger} from '../../../lib/logger';
import {initConverter, NAME_FAKE_DRIVER_MODULE} from '../helpers';
-
+describe('@appium/typedoc-plugin-appium', function () {
describe('BuiltinExternalDriverConverter', function () {
let sandbox: SinonSandbox;
@@ -63,6 +63,10 @@ describe('BuiltinExternalDriverConverter', function () {
({method, comment} = knownMethods.get('activateApp')!);
expect(method).to.exist;
expect(comment).to.exist;
+ ({method, comment} = knownMethods.get('executeCdp')!);
+ expect(method).to.exist;
+ expect(comment).to.exist;
+ });
});
});
});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/builtin-method-map.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/builtin-method-map.spec.ts
@@ -3,14 +3,17 @@ import _ from 'lodash';
import {createSandbox, SinonSandbox} from 'sinon';
import {Comment, Context} from 'typedoc';
import {
+ BuiltinExternalDriverConverter,
BuiltinMethodMapConverter,
KnownMethods,
NAME_BUILTIN_COMMAND_MODULE,
+ NAME_TYPES_MODULE,
} from '../../../lib/converter';
import {BuiltinCommands} from '../../../lib/model/builtin-commands';
import {AppiumPluginLogger} from '../../../lib/logger';
import {initConverter, NAME_FAKE_DRIVER_MODULE} from '../helpers';
+describe('@appium/typedoc-plugin-appium', function () {
describe('BuiltinMethodMapConverter', function () {
let sandbox: SinonSandbox;
@@ -37,11 +40,15 @@ describe('BuiltinMethodMapConverter', function () {
describe('convert()', function () {
describe('when provided the correct module', function () {
let builtinSource: BuiltinCommands;
+ let converter: BuiltinMethodMapConverter;
before(async function () {
- const converter = await initConverter(
+ const knownMethods = (
+ await initConverter(BuiltinExternalDriverConverter, NAME_TYPES_MODULE)
+ ).convert();
+ converter = await initConverter(
BuiltinMethodMapConverter,
NAME_BUILTIN_COMMAND_MODULE,
- {extraArgs: [new Map()]}
+ {extraArgs: [knownMethods]}
);
builtinSource = converter.convert()!;
});
@@ -57,7 +64,9 @@ describe('BuiltinMethodMapConverter', function () {
});
it('should contain command data per route', function () {
- const firstCommand = [...builtinSource.moduleCmds!.routeMap.get('/session')!.values()][0];
+ const firstCommand = [
+ ...builtinSource.moduleCmds!.routeMap.get('/session')!.values(),
+ ][0];
expect(firstCommand).to.exist;
expect(_.omit(firstCommand, 'methodRefl', 'parentRefl', 'comment', 'log')).to.eql({
command: 'createSession',
@@ -76,11 +85,16 @@ describe('BuiltinMethodMapConverter', function () {
});
it(`should only work with ${NAME_BUILTIN_COMMAND_MODULE}`, async function () {
- const converter = await initConverter(BuiltinMethodMapConverter, NAME_FAKE_DRIVER_MODULE, {
+ const converter = await initConverter(
+ BuiltinMethodMapConverter,
+ NAME_FAKE_DRIVER_MODULE,
+ {
extraArgs: [new Map()],
- });
+ }
+ );
expect(converter.convert().toProjectCommands()).to.be.empty;
});
});
});
});
+});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/comment.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/comment.spec.ts
@@ -7,6 +7,8 @@ import {
} from '../../../lib/converter';
import {initConverter} from '../helpers';
+describe('@appium/typedoc-plugin-appium', function () {
+ describe('comment', function () {
describe('deriveComment()', function () {
let knownMethods: KnownMethods;
@@ -24,3 +26,5 @@ describe('deriveComment()', function () {
});
});
});
+ });
+});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/external.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/external.spec.ts
@@ -14,7 +14,7 @@ import {isCallSignatureReflectionWithArity} from '../../../lib/guards';
import {AppiumPluginLogger} from '../../../lib/logger';
import {CommandSet, ModuleCommands, ProjectCommands} from '../../../lib/model';
import {initConverter, NAME_FAKE_DRIVER_MODULE} from '../helpers';
-
+describe('@appium/typedoc-plugin-appium', function () {
describe('ExternalConverter', function () {
let sandbox: SinonSandbox;
@@ -43,7 +43,10 @@ describe('ExternalConverter', function () {
let builtinCmdSrc: BuiltinCommands;
before(async function () {
- const bedConverter = await initConverter(BuiltinExternalDriverConverter, NAME_TYPES_MODULE);
+ const bedConverter = await initConverter(
+ BuiltinExternalDriverConverter,
+ NAME_TYPES_MODULE
+ );
externalDriverMethods = bedConverter.convert();
const bmmConverter = await initConverter(
BuiltinMethodMapConverter,
@@ -74,7 +77,9 @@ describe('ExternalConverter', function () {
});
it('should find commands from the new method map', function () {
- expect(fakeDriverCmds.routeMap.get('/session/:sessionId/fakedriver')).to.have.lengthOf(2);
+ expect(fakeDriverCmds.routeMap.get('/session/:sessionId/fakedriver')).to.have.lengthOf(
+ 2
+ );
});
it('should find commands in the execute method map', function () {
@@ -93,8 +98,9 @@ describe('ExternalConverter', function () {
it('should prefer method map parameters over method parameters', function () {
const postRoute = [...sessionCmdSet].find((cmdData) => cmdData.httpMethod === 'POST')!;
- const pRefls = postRoute.methodRefl!.signatures!.find(isCallSignatureReflectionWithArity)!
- .parameters!;
+ const pRefls = postRoute.methodRefl!.signatures!.find(
+ isCallSignatureReflectionWithArity
+ )!.parameters!;
// the method has 4 parameters, but the method map has 3
expect(pRefls).to.have.lengthOf(4);
@@ -141,3 +147,4 @@ describe('ExternalConverter', function () {
});
});
});
+});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/index.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/index.spec.ts
@@ -11,6 +11,7 @@ import {initAppForPkgs, NAME_FAKE_DRIVER_MODULE, ROOT_TSCONFIG} from '../helpers
const {expect} = chai;
+describe('@appium/typedoc-plugin-appium', function () {
describe('converter', function () {
let sandbox: SinonSandbox;
beforeEach(function () {
@@ -37,9 +38,11 @@ describe('converter', function () {
});
log = new AppiumPluginLogger(app.logger, 'appium-test');
});
+
describe('convertCommands()', function () {
it('should return a non-empty ProjectCommands Map', () => {
expect(convertCommands(ctx, log)).to.be.an.instanceof(ProjectCommands).and.not.to.be.empty;
});
});
});
+});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/plugin.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/plugin.spec.ts
@@ -25,7 +25,7 @@ import {
import {initAppForPkgs, NAME_FAKE_DRIVER_MODULE, ROOT_TSCONFIG} from '../helpers';
const {expect} = chai;
-
+describe('@appium/typedoc-plugin-appium', function () {
describe('plugin', function () {
let sandbox: SinonSandbox;
/**
@@ -166,7 +166,9 @@ describe('plugin', function () {
~(AppiumPluginReflectionKind.Extension as any)
);
expect(defaultRefls).to.not.be.empty;
- const pluginRefls = project.getChildrenByKind(AppiumPluginReflectionKind.Extension as any);
+ const pluginRefls = project.getChildrenByKind(
+ AppiumPluginReflectionKind.Extension as any
+ );
expect(pluginRefls).to.not.be.empty;
});
@@ -176,3 +178,4 @@ describe('plugin', function () {
});
});
});
+});

MODIFY
packages/typedoc-plugin-appium/test/unit/converter/utils.spec.ts
packages/typedoc-plugin-appium/test/unit/converter/utils.spec.ts
@@ -18,7 +18,7 @@ import {
} from '../../../lib/converter';
const {expect} = chai;
-
+describe('@appium/typedoc-plugin-appium', function () {
describe('utils', function () {
let sandbox: SinonSandbox;
@@ -123,3 +123,4 @@ describe('utils', function () {
});
});
});
+});

chore(typedoc-plugin-appium): wrap all tests in same suite title

Everything else here is whitespace.

Using this pattern helps with some 3p tools to navigate tests in the monorepo, as they can easily be grouped by the top-level suite title