Skip to content

Commit 4fb8263

Browse files
authored
docs: change documentation from getInterface to getPlugin
resolves #1162
1 parent 300530d commit 4fb8263

File tree

4 files changed

+43
-14
lines changed

4 files changed

+43
-14
lines changed

docs/api.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80011,6 +80011,10 @@
8001180011
"isExported": true
8001280012
},
8001380013
"originalName": "src/core/lib/interfaces/bdd.ts",
80014+
"comment": {
80015+
"shortText": "This is the BDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
80016+
"text": "```js\nconst { describe, it } = intern.getPlugin('interface.bdd');\n```\n\nIt may also be imported as a module, like\n\n```js\nimport { describe, it } from 'intern/lib/interfaces/bdd';\n```\n\nSuites (`describe`) are registered using callback functions, and tests (`it`) can be registered\nwithin the suite callbacks.\n\n```js\ndescribe('foo', () => {\n before(() => { ... });\n afterEach(() => { ... });\n it('should bar', () => { ... });\n it('should baz', () => { ... });\n});\n"
80017+
},
8001480018
"children": [
8001580019
{
8001680020
"id": 4813,
@@ -80306,7 +80310,7 @@
8030680310
"sources": [
8030780311
{
8030880312
"fileName": "src/core/lib/interfaces/bdd.ts",
80309-
"line": 18,
80313+
"line": 43,
8031080314
"character": 10
8031180315
}
8031280316
]
@@ -80366,7 +80370,7 @@
8036680370
"sources": [
8036780371
{
8036880372
"fileName": "src/core/lib/interfaces/bdd.ts",
80369-
"line": 20,
80373+
"line": 45,
8037080374
"character": 4
8037180375
}
8037280376
]
@@ -80420,7 +80424,7 @@
8042080424
"sources": [
8042180425
{
8042280426
"fileName": "src/core/lib/interfaces/bdd.ts",
80423-
"line": 19,
80427+
"line": 44,
8042480428
"character": 11
8042580429
}
8042680430
]
@@ -80482,7 +80486,7 @@
8048280486
"sources": [
8048380487
{
8048480488
"fileName": "src/core/lib/interfaces/bdd.ts",
80485-
"line": 21,
80489+
"line": 46,
8048680490
"character": 5
8048780491
}
8048880492
]
@@ -80507,7 +80511,7 @@
8050780511
"sources": [
8050880512
{
8050980513
"fileName": "src/core/lib/interfaces/bdd.ts",
80510-
"line": 17,
80514+
"line": 42,
8051180515
"character": 29
8051280516
}
8051380517
],
@@ -80558,7 +80562,7 @@
8055880562
"sources": [
8055980563
{
8056080564
"fileName": "src/core/lib/interfaces/bdd.ts",
80561-
"line": 30,
80565+
"line": 55,
8056280566
"character": 28
8056380567
}
8056480568
]
@@ -81300,8 +81304,8 @@
8130081304
},
8130181305
"originalName": "src/core/lib/interfaces/object.ts",
8130281306
"comment": {
81303-
"shortText": "This is the object interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getInterface]], like:",
81304-
"text": "```js\nconst { registerSuite } = intern.getInterface('object');\n```\n\nIt may also be imported as a module, like\n\n```js\nimport registerSuite from 'intern/lib/interfaces/object';\n```\n\nSuites are described using objects. The object structure is a subset of suite\nproperties, specifically name, the lifecycle methods, and tests.\n\n```js\nregisterSuite('foo', {\n before() {},\n afterEach() {},\n tests: {\n bar() {},\n baz() {}\n }\n});\n```\n\nTests may also describe sub-suites:\n\n```js\nregisterSuite('foo', {\n tests: {\n fooStuff {\n tests: {\n bar() {},\n baz() {}\n }\n }\n }\n});\n```\n\nSub-suites don't need name properties, and may also omit the 'tests' nesting\nif no lifecycle functions are in use. The rule is that if a 'tests' property\nisn't in the sub-suite object, then every property is assumed to refer to a\ntest.\n\n```js\nregisterSuite('foo', {\n fooStuff {\n bar() {},\n baz() {}\n }\n});\n```\n"
81307+
"shortText": "This is the object interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
81308+
"text": "```js\nconst { registerSuite } = intern.getPlugin('interface.object');\n```\n\nIt may also be imported as a module, like\n\n```js\nimport registerSuite from 'intern/lib/interfaces/object';\n```\n\nSuites are described using objects. The object structure is a subset of suite\nproperties, specifically name, the lifecycle methods, and tests.\n\n```js\nregisterSuite('foo', {\n before() {},\n afterEach() {},\n tests: {\n bar() {},\n baz() {}\n }\n});\n```\n\nTests may also describe sub-suites:\n\n```js\nregisterSuite('foo', {\n tests: {\n fooStuff {\n tests: {\n bar() {},\n baz() {}\n }\n }\n }\n});\n```\n\nSub-suites don't need name properties, and may also omit the 'tests' nesting\nif no lifecycle functions are in use. The rule is that if a 'tests' property\nisn't in the sub-suite object, then every property is assumed to refer to a\ntest.\n\n```js\nregisterSuite('foo', {\n fooStuff {\n bar() {},\n baz() {}\n }\n});\n```\n"
8130581309
},
8130681310
"children": [
8130781311
{
@@ -82125,8 +82129,8 @@
8212582129
},
8212682130
"originalName": "src/core/lib/interfaces/tdd.ts",
8212782131
"comment": {
82128-
"shortText": "This is the TDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getInterface]], like:",
82129-
"text": "```js\nconst { suite, test } = intern.getInterface('tdd');\n```\n\nIt may also be imported as a module, like\n\n```js\nimport { suite, test } from 'intern/lib/interfaces/tdd';\n```\n\nSuites are registered using callback functions, and tests can be registered\nwithin the suite callbacks.\n\n```js\nsuite('foo', () => {\n before(() => { ... });\n afterEach(() => { ... });\n test('bar', () => { ... });\n test('baz', () => { ... });\n});\n"
82132+
"shortText": "This is the TDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
82133+
"text": "```js\nconst { suite, test } = intern.getPlugin('interface.tdd');\n```\n\nIt may also be imported as a module, like\n\n```js\nimport { suite, test } from 'intern/lib/interfaces/tdd';\n```\n\nSuites are registered using callback functions, and tests can be registered\nwithin the suite callbacks.\n\n```js\nsuite('foo', () => {\n before(() => { ... });\n afterEach(() => { ... });\n test('bar', () => { ... });\n test('baz', () => { ... });\n});\n"
8213082134
},
8213182135
"children": [
8213282136
{

src/core/lib/interfaces/bdd.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
/**
2+
* This is the BDD interface for registering suites. Typically it will be
3+
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
4+
*
5+
* ```js
6+
* const { describe, it } = intern.getPlugin('interface.bdd');
7+
* ```
8+
*
9+
* It may also be imported as a module, like
10+
*
11+
* ```js
12+
* import { describe, it } from 'intern/lib/interfaces/bdd';
13+
* ```
14+
*
15+
* Suites (`describe`) are registered using callback functions, and tests (`it`) can be registered
16+
* within the suite callbacks.
17+
*
18+
* ```js
19+
* describe('foo', () => {
20+
* before(() => { ... });
21+
* afterEach(() => { ... });
22+
* it('should bar', () => { ... });
23+
* it('should baz', () => { ... });
24+
* });
25+
*/ /** */
126
import { Executor } from '../executors/Executor';
227
import { TestProperties } from '../Test';
328
import {

src/core/lib/interfaces/object.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* This is the object interface for registering suites. Typically it will be
3-
* accessed using [[lib/executors/Executor.Executor.getInterface]], like:
3+
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
44
*
55
* ```js
6-
* const { registerSuite } = intern.getInterface('object');
6+
* const { registerSuite } = intern.getPlugin('interface.object');
77
* ```
88
*
99
* It may also be imported as a module, like

src/core/lib/interfaces/tdd.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* This is the TDD interface for registering suites. Typically it will be
3-
* accessed using [[lib/executors/Executor.Executor.getInterface]], like:
3+
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
44
*
55
* ```js
6-
* const { suite, test } = intern.getInterface('tdd');
6+
* const { suite, test } = intern.getPlugin('interface.tdd');
77
* ```
88
*
99
* It may also be imported as a module, like

0 commit comments

Comments
 (0)