set up scaffolding for tests

This commit is contained in:
Devin Howard 2016-04-25 19:09:22 +08:00
parent 2a3fa80540
commit 10e82b696a
5 changed files with 47 additions and 1 deletions

2
.gitignore vendored
View file

@ -5,10 +5,10 @@
# git config --global core.excludesfile ~/.gitignore_global # git config --global core.excludesfile ~/.gitignore_global
#assety stuff #assety stuff
realtime/node_modules
public/assets public/assets
public/metamaps_mobile public/metamaps_mobile
vendor/ vendor/
node_modules
#secrets and config #secrets and config
.env .env

View file

@ -0,0 +1,9 @@
Change directories to where this file is, and then run
npm install
to set up your testing environment. Then use
npm run test
to see the results of testing the current javascript files.

View file

@ -0,0 +1,22 @@
{
"name": "metamaps-frontend",
"version": "1.0.0",
"description": "Metamaps frontend - currently just tests",
"scripts": {
"test": "mocha test || echo 'Run `npm install` to setup testing'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/metamaps/metamaps.git"
},
"author": "",
"license": "AGPL-3.0",
"bugs": {
"url": "https://github.com/metamaps/metamaps/issues"
},
"homepage": "https://github.com/metamaps/metamaps#readme",
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^2.4.5"
}
}

View file

@ -320,3 +320,5 @@ Metamaps.Import = {
Metamaps.Synapse.renderSynapse(mapping, synapse, node1, node2, true) Metamaps.Synapse.renderSynapse(mapping, synapse, node1, node2, true)
} }
} }
module.exports = Metamaps.Import

View file

@ -0,0 +1,13 @@
var chai = require('chai')
var expect = chai.expect
Metamaps = {}
Metamaps.Import = require('../src/Metamaps.Import')
describe('Metamaps.Import.js', function() {
it('has a topic whitelist', function() {
expect(Metamaps.Import.topicWhitelist).to.deep.equal(
['id', 'name', 'metacode', 'x', 'y', 'description', 'link', 'permission']
)
})
})