This commit is contained in:
syuilo 2021-08-19 11:26:26 +09:00
parent b2b853bded
commit 06ed943395
15 changed files with 5 additions and 138 deletions

View file

@ -35,6 +35,11 @@ If your language is not listed in Crowdin, please open an issue.
## 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
Misskey uses GitHub Actions for executing automated tests.
Configuration files are located in [`/.github/workflows`](/.github/workflows).

View file

@ -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';
import rndstr from 'rndstr';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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 { async } from './utils';
import { getFileInfo } from '../src/misc/get-file-info';

View file

@ -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 mfm from 'mfm-js';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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 { just, nothing } from '../../src/prelude/maybe';

View file

@ -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';

View file

@ -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';
import * as assert from 'assert';

View file

@ -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';
import * as assert from 'assert';