Skip to content
Snippets Groups Projects
Commit b0429288 authored by Xiao Gui's avatar Xiao Gui
Browse files

chore: introduce backend tests

chore: added dataset util test
bugfix: auth util test
parent b97af9e4
No related branches found
No related tags found
No related merge requests found
name: Backend tests
on: [push]
env:
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
HBP_CLIENTID: ${{ secrets.HBP_CLIENTID }}
HBP_CLIENTSECRET: ${{ secrets.HBP_CLIENTSECRET }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: cd into deploy
run: cd deploy
- name: npm install and test
run: |
npm i
npm test
env:
NODE_ENV: test
......@@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [10.x, 12.x]
steps:
- uses: actions/checkout@v1
......
......@@ -23,7 +23,7 @@ describe('chai-as-promised.js', () => {
})
})
describe('util.js with env', (done) => {
describe('util.js with env', async () => {
it('when client id and client secret and refresh token is set, util should not throw', async () => {
......
......@@ -109,5 +109,116 @@ module.exports = [
"doi": "10.1016/j.neuroscience.2009.03.048"
}
]
},
{
"formats": [],
"datasetDOI": [
{
"cite": "Holmseth, S., Scott, H. A., Real, K., Lehre, K. P., Leergaard, T. B., Bjaalie, J. G., & Danbolt, N. C. (2009). The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation. Neuroscience, 162(4), 1055–1071. ",
"doi": "10.1016/j.neuroscience.2009.03.048"
}
],
"activity": [
{
"protocols": [
"Immunohistochemistry",
"Atlas",
"Brain-wide",
"Synaptic transmission",
"Neurtransmitter transport",
"Glutamate uptake",
"GLT1"
],
"preparation": [
"Ex vivo"
]
}
],
"referenceSpaces": [],
"methods": [
"Immunohistochemistry"
],
"custodians": [
"Danbolt, Niels C."
],
"project": [
"Rodent brain neurotransporter atlas: GLT1"
],
"description": "Glutamate is the major excitatory transmitter in the central nervous system (Danbolt, Prog. Neurobiol. 65:1-105, 2001). It is inactivated by cellular uptake, mostly catalyzed by the glutamate transporters GLT1 (slc1a2, excitatory amino acid transporter [EAAT2]) subtype expressed at high levels in brain astrocytes and at lower levels in neurons. Three C-terminal variants of EAAT2 exist: GLT1a (Pines et al., Nature 360:464-467, 1992), GLT1b (Utsunomiya-Tate et al., FEBS Lett 416:312-326,1997), and GLT1c (Rauen et al., Neurochem. Int. 45:1095-1106, 2004). This dataset is brain-wide collection of microscopic images showing the brain-wide distribution of GLT1 in the mouse and rat brain, visualized by immunohistochemistry using antibodies against GLT1a and GLT1b. To facilitate identification of anatomical location adjacent section were stained to reveal cyto- and myeloarchitecture.",
"parcellationAtlas": [
{
"name": "Allen Mouse Common Coordinate Framework v3 2015",
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/parcellationatlas/v1.0.0/39a1384b-8413-4d27-af8d-22432225401f",
"id": "39a1384b-8413-4d27-af8d-22432225401f"
},
{
"name": "Waxholm Space rat brain atlas v2",
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/parcellationatlas/v1.0.0/2449a7f0-6dd0-4b5a-8f1e-aec0db03679d",
"id": "2449a7f0-6dd0-4b5a-8f1e-aec0db03679d"
}
],
"licenseInfo": [
{
"name": "Creative Commons Attribution-ShareAlike 4.0 International",
"url": "https://creativecommons.org/licenses/by-sa/4.0"
}
],
"embargoStatus": [
"Free"
],
"license": [
{
"name": "Creative Commons Attribution-ShareAlike 4.0 International",
"relativeUrl": "minds/core/licensetype/v1.0.0/78a3bfb2-f4b9-40f0-869c-34b5e48a45bd"
}
],
"parcellationRegion": [
{
"species": [],
"name": "Mouse Whole brain (v3 2015)",
"alias": "Whole brain"
},
{
"species": [
{
"identifier": [
"e9a384ea8a4edf817710b6edef5f2940",
"5401fdb1d638c2bc5b68241560cddac0"
],
"name": "Rattus norvegicus",
"@id": "https://nexus.humanbrainproject.org/v0/data/minds/core/species/v1.0.0/f3490d7f-8f7f-4b40-b238-963dcac84412"
}
],
"name": "Whole Brain ",
"alias": "Whole brain"
}
],
"species": [
"Rattus norvegicus",
"Mus musculus"
],
"name": "Brain-wide distribution of glutamate type 1 transporter protein (GLT1)",
"files": [],
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/dataset/v1.0.0/f7a7d460-8724-4cd1-a06e-457eb8954fbd",
"contributors": [
"Danbolt, Nils C.",
"Bjaalie, Jan G.",
"Leergaard, Trygve B.",
"Lehre, K.P.",
"Real, Katia",
"Scott, Heather A.",
"Holmseth, Silvia"
],
"id": "63bbb845ac6d2f1839f919c2ef0455bc",
"kgReference": [
"10.25493/Y147-2CE"
],
"publications": [
{
"name": "The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation",
"cite": "Holmseth, S., Scott, H. A., Real, K., Lehre, K. P., Leergaard, T. B., Bjaalie, J. G., & Danbolt, N. C. (2009). The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation. Neuroscience, 162(4), 1055–1071. ",
"doi": "10.1016/j.neuroscience.2009.03.048"
}
]
}
]
\ No newline at end of file
......@@ -109,5 +109,116 @@ module.exports = [
"doi": "10.1016/j.neuroscience.2009.03.048"
}
]
},
{
"formats": [],
"datasetDOI": [
{
"cite": "Holmseth, S., Scott, H. A., Real, K., Lehre, K. P., Leergaard, T. B., Bjaalie, J. G., & Danbolt, N. C. (2009). The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation. Neuroscience, 162(4), 1055–1071. ",
"doi": "10.1016/j.neuroscience.2009.03.048"
}
],
"activity": [
{
"protocols": [
"Immunohistochemistry",
"Atlas",
"Brain-wide",
"Synaptic transmission",
"Neurtransmitter transport",
"Glutamate uptake",
"GLT1"
],
"preparation": [
"Ex vivo"
]
}
],
"referenceSpaces": [],
"methods": [
"Immunohistochemistry"
],
"custodians": [
"Danbolt, Niels C."
],
"project": [
"Rodent brain neurotransporter atlas: GLT1"
],
"description": "Glutamate is the major excitatory transmitter in the central nervous system (Danbolt, Prog. Neurobiol. 65:1-105, 2001). It is inactivated by cellular uptake, mostly catalyzed by the glutamate transporters GLT1 (slc1a2, excitatory amino acid transporter [EAAT2]) subtype expressed at high levels in brain astrocytes and at lower levels in neurons. Three C-terminal variants of EAAT2 exist: GLT1a (Pines et al., Nature 360:464-467, 1992), GLT1b (Utsunomiya-Tate et al., FEBS Lett 416:312-326,1997), and GLT1c (Rauen et al., Neurochem. Int. 45:1095-1106, 2004). This dataset is brain-wide collection of microscopic images showing the brain-wide distribution of GLT1 in the mouse and rat brain, visualized by immunohistochemistry using antibodies against GLT1a and GLT1b. To facilitate identification of anatomical location adjacent section were stained to reveal cyto- and myeloarchitecture.",
"parcellationAtlas": [
{
"name": "Allen Mouse Common Coordinate Framework v3 2015",
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/parcellationatlas/v1.0.0/39a1384b-8413-4d27-af8d-22432225401f",
"id": "39a1384b-8413-4d27-af8d-22432225401f"
},
{
"name": "Waxholm Space rat brain atlas v2",
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/parcellationatlas/v1.0.0/2449a7f0-6dd0-4b5a-8f1e-aec0db03679d",
"id": "2449a7f0-6dd0-4b5a-8f1e-aec0db03679d"
}
],
"licenseInfo": [
{
"name": "Creative Commons Attribution-ShareAlike 4.0 International",
"url": "https://creativecommons.org/licenses/by-sa/4.0"
}
],
"embargoStatus": [
"Free"
],
"license": [
{
"name": "Creative Commons Attribution-ShareAlike 4.0 International",
"relativeUrl": "minds/core/licensetype/v1.0.0/78a3bfb2-f4b9-40f0-869c-34b5e48a45bd"
}
],
"parcellationRegion": [
{
"species": [],
"name": "Mouse Whole brain (v3 2015)",
"alias": "Whole brain"
},
{
"species": [
{
"identifier": [
"e9a384ea8a4edf817710b6edef5f2940",
"5401fdb1d638c2bc5b68241560cddac0"
],
"name": "Rattus norvegicus",
"@id": "https://nexus.humanbrainproject.org/v0/data/minds/core/species/v1.0.0/f3490d7f-8f7f-4b40-b238-963dcac84412"
}
],
"name": "Whole Brain ",
"alias": "Whole brain"
}
],
"species": [
"Rattus norvegicus",
"Mus musculus"
],
"name": "Brain-wide distribution of glutamate type 1 transporter protein (GLT1)",
"files": [],
"fullId": "https://nexus.humanbrainproject.org/v0/data/minds/core/dataset/v1.0.0/f7a7d460-8724-4cd1-a06e-457eb8954fbd",
"contributors": [
"Danbolt, Nils C.",
"Bjaalie, Jan G.",
"Leergaard, Trygve B.",
"Lehre, K.P.",
"Real, Katia",
"Scott, Heather A.",
"Holmseth, Silvia"
],
"id": "63bbb845ac6d2f1839f919c2ef0455bc",
"kgReference": [
"10.25493/Y147-2CE"
],
"publications": [
{
"name": "The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation",
"cite": "Holmseth, S., Scott, H. A., Real, K., Lehre, K. P., Leergaard, T. B., Bjaalie, J. G., & Danbolt, N. C. (2009). The concentrations and distributions of three C-terminal variants of the GLT1 (EAAT2; slc1a2) glutamate transporter protein in rat brain tissue suggest differential regulation. Neuroscience, 162(4), 1055–1071. ",
"doi": "10.1016/j.neuroscience.2009.03.048"
}
]
}
]
\ No newline at end of file
......@@ -2,6 +2,7 @@ const { retry, filterDatasets, datasetRegionExistsInParcellationRegion, _getParc
const { fake } = require('sinon')
const { assert, expect } = require('chai')
const waxholmv2 = require('./testData/waxholmv2')
const allen2015 = require('./testData/allen2015')
describe('datasets/util.js', () => {
......@@ -64,9 +65,20 @@ describe('datasets/util.js', () => {
})
describe('filterDatasets', () => {
it('should filter waxholm v1 properly', async () => {
const filteredResult = await filterDatasets(waxholmv2, { parcellationName: 'Waxholm Space rat brain atlas v1' })
expect(filteredResult).to.have.length(0)
})
it('should filter waxholm v2 properly', async () => {
const filteredResult = await filterDatasets(waxholmv2, { parcellationName: 'Waxholm Space rat brain atlas v2' })
expect(filteredResult).to.have.length(1)
expect(filteredResult).to.have.length(2)
})
it('should filter allen 2015 properly', async () => {
const filteredResult = await filterDatasets(allen2015, { parcellationName: 'Allen Mouse Common Coordinate Framework v3 2015' })
expect(filteredResult).to.have.length(2)
})
})
......
......@@ -6,8 +6,8 @@
"scripts": {
"start": "node server.js",
"test": "npm run testEnv && npm run testNoEnv",
"testEnv": "node -r dotenv/config ./node_modules/.bin/mocha ./test/mocha.test.js",
"testNoEnv": "node ./node_modules/.bin/mocha ./test/mocha.test.noenv.js",
"testEnv": "node -r dotenv/config ./node_modules/.bin/mocha ./test/mocha.test.js --timeout 10000",
"testNoEnv": "node ./node_modules/.bin/mocha ./test/mocha.test.noenv.js --timeout 10000",
"mocha": "mocha"
},
"keywords": [],
......
require('../auth/util.spec')
require('../compression/index.spec')
\ No newline at end of file
require('../datasets/query.spec')
require('../datasets/util.spec')
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment