refactor
This commit is contained in:
parent
881b914c6a
commit
4c431c5432
|
@ -35,6 +35,11 @@ If your language is not listed in Crowdin, please open an issue.
|
||||||
## Test
|
## Test
|
||||||
* Test codes are located in [`/test`](/test).
|
* Test codes are located in [`/test`](/test).
|
||||||
|
|
||||||
|
### Run specify test
|
||||||
|
```
|
||||||
|
npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/foo.ts --require ts-node/register
|
||||||
|
```
|
||||||
|
|
||||||
## Continuous integration
|
## Continuous integration
|
||||||
Misskey uses GitHub Actions for executing automated tests.
|
Misskey uses GitHub Actions for executing automated tests.
|
||||||
Configuration files are located in [`/.github/workflows`](/.github/workflows).
|
Configuration files are located in [`/.github/workflows`](/.github/workflows).
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests for ActivityPub
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" mocha test/activitypub.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/activitypub.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import rndstr from 'rndstr';
|
import rndstr from 'rndstr';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of API (visibility)
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/api-visibility.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/api-visibility.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of API
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/api.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/api.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
/*
|
/*
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of block
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/block.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/block.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of chart engine
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/chart.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/chart.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests for Fetch resource
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/fetch-resource.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/fetch-resource.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests for detection of file information
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true npx mocha test/get-file-info.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true npx mocha test/get-file-info.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { async } from './utils';
|
import { async } from './utils';
|
||||||
import { getFileInfo } from '../src/misc/get-file-info';
|
import { getFileInfo } from '../src/misc/get-file-info';
|
||||||
|
|
10
test/mfm.ts
10
test/mfm.ts
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of MFM
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/mfm.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/mfm.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import * as mfm from 'mfm-js';
|
import * as mfm from 'mfm-js';
|
||||||
|
|
||||||
|
|
10
test/mute.ts
10
test/mute.ts
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of mute
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/mute.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/mute.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
10
test/note.ts
10
test/note.ts
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of Note
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/note.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/note.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of Maybe
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/prelude/maybe.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/prelude/maybe.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
import { just, nothing } from '../../src/prelude/maybe';
|
import { just, nothing } from '../../src/prelude/maybe';
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of MFM
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/reaction-lib.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/reaction-lib.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of streaming API
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/streaming.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/streaming.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
|
@ -1,13 +1,3 @@
|
||||||
/*
|
|
||||||
* Tests of Note
|
|
||||||
*
|
|
||||||
* How to run the tests:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/user-notes.ts --require ts-node/register
|
|
||||||
*
|
|
||||||
* To specify test:
|
|
||||||
* > npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true npx mocha test/user-notes.ts --require ts-node/register -g 'test name'
|
|
||||||
*/
|
|
||||||
|
|
||||||
process.env.NODE_ENV = 'test';
|
process.env.NODE_ENV = 'test';
|
||||||
|
|
||||||
import * as assert from 'assert';
|
import * as assert from 'assert';
|
||||||
|
|
Loading…
Reference in a new issue