Skip to content

Commit

Permalink
move tests for nodejs to its own package
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Parfenov <[email protected]>
  • Loading branch information
Andrey1994 committed Sep 13, 2023
1 parent 06deccb commit b7aedb2
Show file tree
Hide file tree
Showing 19 changed files with 200 additions and 65 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/run_unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ jobs:
- name: Build Node Package
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
npm install --force
npm install
npm run build
- name: Install Node Tests
run: |
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm install
- name: Setup Java package
run: |
cd $GITHUB_WORKSPACE/java_package/brainflow
Expand Down Expand Up @@ -318,27 +323,31 @@ jobs:
LD_LIBRARY_PATH: ${{ github.workspace }}/installed/lib
- name: Synthetic Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run brainflow_get_data
- name: Signal Filters Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run signal_filtering
- name: Serialization Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run serialization
- name: Downsampling Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run downsampling
- name: Denoising Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run denoising
- name: EEG Metrics Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run eeg_metrics
- name: BandPowerAll Node
run: |
cd $GITHUB_WORKSPACE/nodejs_package/brainflow
cd $GITHUB_WORKSPACE/nodejs_package/tests
npm run bandpower_all
# deploy started
- name: Install AWS CLI
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/run_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ jobs:
- name: Build Node Package
run: |
cd %GITHUB_WORKSPACE%\nodejs_package\brainflow
npm install --force
npm install
npm run build
shell: cmd
- name: Build Install Node Tests
run: |
cd %GITHUB_WORKSPACE%\nodejs_package\tests
npm install
shell: cmd
- name: Build Java Package
run: |
Expand Down Expand Up @@ -296,7 +302,7 @@ jobs:
shell: cmd
- name: Synthetic Node
run: |
cd %GITHUB_WORKSPACE%\nodejs_package\brainflow
cd %GITHUB_WORKSPACE%\nodejs_package\tests
npm run brainflow_get_data
shell: cmd
# Start Deploy Stage
Expand Down
20 changes: 10 additions & 10 deletions docs/Examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -545,61 +545,61 @@ Typescript
Typescript Get Data from a Board
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/brainflow_get_data.ts
.. literalinclude:: ../nodejs_package/tests/brainflow_get_data.ts
:language: javascript

Typescript Markers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/markers.ts
.. literalinclude:: ../nodejs_package/tests/markers.ts
:language: javascript

Typescript Read Write File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/serialization.ts
.. literalinclude:: ../nodejs_package/tests/serialization.ts
:language: javascript

Typescript Downsample Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/downsampling.ts
.. literalinclude:: ../nodejs_package/tests/downsampling.ts
:language: javascript

Typescript Transforms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/transforms.ts
.. literalinclude:: ../nodejs_package/tests/transforms.ts
:language: javascript

Typescript Signal Filtering
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/signal_filtering.ts
.. literalinclude:: ../nodejs_package/tests/signal_filtering.ts
:language: javascript

Typescript Denoising
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/denoising.ts
.. literalinclude:: ../nodejs_package/tests/denoising.ts
:language: javascript

Typescript Band Power
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/bandpower.ts
.. literalinclude:: ../nodejs_package/tests/bandpower.ts
:language: javascript

Typescript EEG Metrics
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/eeg_metrics.ts
.. literalinclude:: ../nodejs_package/tests/eeg_metrics.ts
:language: javascript

Typescript ICA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. literalinclude:: ../nodejs_package/brainflow/tests/ica.ts
.. literalinclude:: ../nodejs_package/tests/ica.ts
:language: javascript

Notebooks
Expand Down
2 changes: 1 addition & 1 deletion docs/UserAPI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ Typescript binding calls C/C++ code as any other binding. Use Typescript example

Example:

.. literalinclude:: ../nodejs_package/brainflow/tests/brainflow_get_data.ts
.. literalinclude:: ../nodejs_package/tests/brainflow_get_data.ts
:language: javascript
13 changes: 1 addition & 12 deletions nodejs_package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@
"test": "jest",
"test:watch": "jest --watchAll",
"build": "tsc",
"watch": "tsc -w",
"markers": "ts-node brainflow/tests/markers.ts",
"ica": "ts-node brainflow/tests/ica.ts",
"brainflow_get_data": "ts-node brainflow/tests/brainflow_get_data.ts",
"signal_filtering": "ts-node brainflow/tests/signal_filtering.ts",
"serialization": "ts-node brainflow/tests/serialization.ts",
"downsampling": "ts-node brainflow/tests/downsampling.ts",
"transforms": "ts-node brainflow/tests/transforms.ts",
"denoising": "ts-node brainflow/tests/denoising.ts",
"bandpower": "ts-node brainflow/tests/bandpower.ts",
"bandpower_all": "ts-node brainflow/tests/bandpower_all.ts",
"eeg_metrics": "ts-node brainflow/tests/eeg_metrics.ts"
"watch": "tsc -w"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds, WindowOperations} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter, WindowOperations} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds} from '../brainflow.types';
import {BoardIds, BoardShim} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds, WaveletTypes} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter, WaveletTypes} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {AggOperations, BoardIds} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {AggOperations, BoardIds, BoardShim, DataFilter} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import {BoardShim} from '../board_shim';
import {BoardIds, BrainFlowClassifiers, BrainFlowMetrics} from '../brainflow.types';
import {DataFilter} from '../data_filter'
import {MLModel} from '../ml_model';
import {
BoardIds,
BoardShim,
BrainFlowClassifiers,
BrainFlowMetrics,
DataFilter,
MLModel
} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds} from '../brainflow.types';
import {BoardIds, BoardShim} from 'brainflow';

function sleep (ms: number)
{
Expand Down
29 changes: 29 additions & 0 deletions nodejs_package/tests/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "tests",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"markers": "ts-node markers.ts",
"ica": "ts-node ica.ts",
"brainflow_get_data": "ts-node brainflow_get_data.ts",
"signal_filtering": "ts-node signal_filtering.ts",
"serialization": "ts-node serialization.ts",
"downsampling": "ts-node downsampling.ts",
"transforms": "ts-node transforms.ts",
"denoising": "ts-node denoising.ts",
"bandpower": "ts-node bandpower.ts",
"bandpower_all": "ts-node bandpower_all.ts",
"eeg_metrics": "ts-node eeg_metrics.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.6.0",
"typescript": "^5.2.2"
},
"dependencies": {
"brainflow": "file:.."
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {BoardShim} from '../board_shim';
import {BoardIds, FilterTypes} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {BoardIds, BoardShim, DataFilter, FilterTypes} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import {BoardShim} from '../board_shim';
import {BoardIds, WaveletExtensionTypes, WaveletTypes, WindowOperations} from '../brainflow.types';
import {DataFilter} from '../data_filter';
import {
BoardIds,
BoardShim,
DataFilter,
WaveletExtensionTypes,
WaveletTypes,
WindowOperations
} from 'brainflow';

function sleep (ms: number)
{
Expand Down
Loading

0 comments on commit b7aedb2

Please sign in to comment.