Skip to content

Commit

Permalink
docs: change documentation from getInterface to getPlugin
Browse files Browse the repository at this point in the history
resolves #1162
  • Loading branch information
msssk authored Jun 2, 2020
1 parent 300530d commit 4fb8263
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
24 changes: 14 additions & 10 deletions docs/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -80011,6 +80011,10 @@
"isExported": true
},
"originalName": "src/core/lib/interfaces/bdd.ts",
"comment": {
"shortText": "This is the BDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
"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"
},
"children": [
{
"id": 4813,
Expand Down Expand Up @@ -80306,7 +80310,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 18,
"line": 43,
"character": 10
}
]
Expand Down Expand Up @@ -80366,7 +80370,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 20,
"line": 45,
"character": 4
}
]
Expand Down Expand Up @@ -80420,7 +80424,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 19,
"line": 44,
"character": 11
}
]
Expand Down Expand Up @@ -80482,7 +80486,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 21,
"line": 46,
"character": 5
}
]
Expand All @@ -80507,7 +80511,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 17,
"line": 42,
"character": 29
}
],
Expand Down Expand Up @@ -80558,7 +80562,7 @@
"sources": [
{
"fileName": "src/core/lib/interfaces/bdd.ts",
"line": 30,
"line": 55,
"character": 28
}
]
Expand Down Expand Up @@ -81300,8 +81304,8 @@
},
"originalName": "src/core/lib/interfaces/object.ts",
"comment": {
"shortText": "This is the object interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getInterface]], like:",
"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"
"shortText": "This is the object interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
"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"
},
"children": [
{
Expand Down Expand Up @@ -82125,8 +82129,8 @@
},
"originalName": "src/core/lib/interfaces/tdd.ts",
"comment": {
"shortText": "This is the TDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getInterface]], like:",
"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"
"shortText": "This is the TDD interface for registering suites. Typically it will be\naccessed using [[lib/executors/Executor.Executor.getPlugin]], like:",
"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"
},
"children": [
{
Expand Down
25 changes: 25 additions & 0 deletions src/core/lib/interfaces/bdd.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/**
* This is the BDD interface for registering suites. Typically it will be
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
*
* ```js
* const { describe, it } = intern.getPlugin('interface.bdd');
* ```
*
* It may also be imported as a module, like
*
* ```js
* import { describe, it } from 'intern/lib/interfaces/bdd';
* ```
*
* Suites (`describe`) are registered using callback functions, and tests (`it`) can be registered
* within the suite callbacks.
*
* ```js
* describe('foo', () => {
* before(() => { ... });
* afterEach(() => { ... });
* it('should bar', () => { ... });
* it('should baz', () => { ... });
* });
*/ /** */
import { Executor } from '../executors/Executor';
import { TestProperties } from '../Test';
import {
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/interfaces/object.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This is the object interface for registering suites. Typically it will be
* accessed using [[lib/executors/Executor.Executor.getInterface]], like:
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
*
* ```js
* const { registerSuite } = intern.getInterface('object');
* const { registerSuite } = intern.getPlugin('interface.object');
* ```
*
* It may also be imported as a module, like
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/interfaces/tdd.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* This is the TDD interface for registering suites. Typically it will be
* accessed using [[lib/executors/Executor.Executor.getInterface]], like:
* accessed using [[lib/executors/Executor.Executor.getPlugin]], like:
*
* ```js
* const { suite, test } = intern.getInterface('tdd');
* const { suite, test } = intern.getPlugin('interface.tdd');
* ```
*
* It may also be imported as a module, like
Expand Down

0 comments on commit 4fb8263

Please sign in to comment.