set up scaffolding for tests
This commit is contained in:
parent
2a3fa80540
commit
10e82b696a
5 changed files with 47 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,10 +5,10 @@
|
|||
# git config --global core.excludesfile ~/.gitignore_global
|
||||
|
||||
#assety stuff
|
||||
realtime/node_modules
|
||||
public/assets
|
||||
public/metamaps_mobile
|
||||
vendor/
|
||||
node_modules
|
||||
|
||||
#secrets and config
|
||||
.env
|
||||
|
|
9
app/assets/javascripts/README-testing-js.md
Normal file
9
app/assets/javascripts/README-testing-js.md
Normal 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.
|
22
app/assets/javascripts/package.json
Normal file
22
app/assets/javascripts/package.json
Normal 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"
|
||||
}
|
||||
}
|
|
@ -320,3 +320,5 @@ Metamaps.Import = {
|
|||
Metamaps.Synapse.renderSynapse(mapping, synapse, node1, node2, true)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Metamaps.Import
|
||||
|
|
13
app/assets/javascripts/test/Metamaps.Import.spec.js
Normal file
13
app/assets/javascripts/test/Metamaps.Import.spec.js
Normal 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']
|
||||
)
|
||||
})
|
||||
})
|
Loading…
Add table
Reference in a new issue