Skip to content

Commit 6439829

Browse files
committed
test: add-role tests
1 parent c107a72 commit 6439829

56 files changed

Lines changed: 2128 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/actions/add-role/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
async function addRole (options) {
3+
4+
}
5+
6+
module.exports = addRole

lib/actions/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ module.exports = {
44
addModelAction: require('./add-model'),
55
addEditableAction: require('./add-editable'),
66
addStateMachine: require('./add-state-machine'),
7-
addCategory: require('./add-category')
7+
addCategory: require('./add-category'),
8+
addRole: require('./add-role')
89
}

test/add-role-test.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* eslint-env mocha */
2+
3+
const helpers = require('./test-helpers')
4+
5+
const addCategory = require('../lib/actions').addRole
6+
7+
describe('tymly add-role', () => {
8+
const tests = {
9+
'add-role': [
10+
'pizza',
11+
'',
12+
'',
13+
''
14+
],
15+
'fill-out-role': [
16+
'chef',
17+
'The Pizza Chef',
18+
'Someone who makes pizzas',
19+
''
20+
],
21+
'member-of-role': [
22+
'maestro',
23+
'The Pizza Maestro',
24+
'Someone who makes master pizzas',
25+
helpers.down + ' '
26+
]
27+
}
28+
29+
const suiteName = 'add-role'
30+
31+
before(() => {
32+
helpers.prepareFixture(suiteName)
33+
})
34+
35+
for (const [name, inputs] of Object.entries(tests)) {
36+
helpers.runTest(
37+
suiteName,
38+
name,
39+
inputs,
40+
addCategory,
41+
{ }
42+
)
43+
}
44+
})
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
*.log
26+
27+
*.sqlite
28+
29+
## Node ###
30+
~*
31+
.~*
32+
\#*
33+
34+
# Logs
35+
logs
36+
*.log
37+
npm-debug.log*
38+
39+
# Runtime data
40+
pids
41+
*.pid
42+
*.seed
43+
*.pid.lock
44+
45+
# Directory for instrumented libs generated by jscoverage/JSCover
46+
lib-cov
47+
48+
# Coverage directory used by tools like istanbul
49+
coverage
50+
51+
# nyc test coverage
52+
.nyc_output
53+
54+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
55+
.grunt
56+
57+
# node-waf configuration
58+
.lock-wscript
59+
60+
# Compiled binary addons (http://nodejs.org/api/addons.html)
61+
build/Release
62+
63+
# Dependency directories
64+
node_modules
65+
jspm_packages
66+
67+
# Optional npm cache directory
68+
.npm
69+
70+
# Optional eslint cache
71+
.eslintcache
72+
73+
# Optional REPL history
74+
.node_repl_history
75+
76+
# Output of 'npm pack'
77+
*.tgz
78+
79+
# Yarn Integrity file
80+
.yarn-integrity
81+
82+
83+
## IDE things ##
84+
85+
# Webstorm
86+
.idea
87+
88+
# Eclipse:
89+
90+
.project
91+
.metadata
92+
bin/
93+
tmp/
94+
*.tmp
95+
*.bak
96+
*.swp
97+
*~.nib
98+
local.properties
99+
.settings/
100+
.loadpath
101+
.recommenders
102+
103+
104+
scratch.txt
105+
package-lock.json
106+
107+
output/
108+
109+
# Ignore Rush temporary files
110+
/common/temp/**
111+
112+
package-deps.json
113+
114+
.yo-rc.json
115+
116+
lerna-debug.log
117+
118+
TEST-result.xml
119+
.gradle/
120+
.embedpostgresql/
121+
build/
122+
123+
# Windows thumbnail cache files
124+
Thumbs.db
125+
ehthumbs.db
126+
ehthumbs_vista.db
127+
128+
# Dump file
129+
*.stackdump
130+
131+
# Folder config file
132+
[Dd]esktop.ini
133+
134+
# Recycle Bin used on file shares
135+
$RECYCLE.BIN/
136+
137+
# Windows Installer files
138+
*.cab
139+
*.msi
140+
*.msix
141+
*.msm
142+
*.msp
143+
144+
# Windows shortcuts
145+
*.lnk
146+
147+
# OS generated files #
148+
######################
149+
.DS_Store
150+
.DS_Store?
151+
._*
152+
.Spotlight-V100
153+
.Trashes
154+
ehthumbs.db
155+
Thumbs.db
156+
.LSOverride
157+
158+
# Icon must end with two \r
159+
Icon
160+
161+
162+
# Thumbnails
163+
._*
164+
165+
# Files that might appear in the root of a volume
166+
.DocumentRevisions-V100
167+
.fseventsd
168+
.Spotlight-V100
169+
.TemporaryItems
170+
.Trashes
171+
.VolumeIcon.icns
172+
.com.apple.timemachine.donotpresent
173+
174+
# Directories potentially created on remote AFP share
175+
.AppleDB
176+
.AppleDesktop
177+
Network Trash Folder
178+
Temporary Items
179+
.apdisk
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"branch": "master",
3+
"analyzeCommits": {
4+
"preset": "angular",
5+
"releaseRules": [
6+
{
7+
"type": "build",
8+
"scope": "deps",
9+
"release": "minor"
10+
}
11+
]
12+
},
13+
"verifyConditions": [
14+
"@semantic-release/changelog",
15+
"@semantic-release/npm",
16+
"@semantic-release/git"
17+
],
18+
"generateNotes": {
19+
"preset": "metahub"
20+
},
21+
"prepare": [
22+
{
23+
"path": "@semantic-release/changelog",
24+
"changelogFile": "CHANGELOG.md"
25+
},
26+
{
27+
"path": "@semantic-release/git",
28+
"assets": [
29+
"CHANGELOG.md"
30+
]
31+
},
32+
"@semantic-release/npm"
33+
],
34+
"publish": [
35+
"@semantic-release/npm",
36+
"@semantic-release/github"
37+
],
38+
"success": [
39+
"@semantic-release/github"
40+
],
41+
"fail": [
42+
"@semantic-release/github"
43+
]
44+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
language: node_js
2+
notifications:
3+
email: false
4+
node_js:
5+
- lts/*
6+
sudo: false
7+
dist: trusty
8+
branches:
9+
only:
10+
- master
11+
env:
12+
global:
13+
- TIMEOUT=15000
14+
install:
15+
- travis_retry npm install
16+
test:
17+
- npm test
18+
before_deploy:
19+
- npm run coverage
20+
deploy:
21+
- provider: script
22+
skip_cleanup: true
23+
script: npx semantic-release
24+
on:
25+
branch: master
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 West Midlands Fire Service
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# tymly-pizza-blueprint
2+
3+
> For ordering delicious pizza
4+
5+
## Install
6+
7+
``` bash
8+
npm install @wmfs/tymly-pizza-blueprint --save
9+
```
10+
11+
## <a name="license"></a>License
12+
13+
MIT
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"namespace": "wmfs",
3+
"name": "tymly-pizza-blueprint",
4+
"version": "1.0.0",
5+
"label": "",
6+
"organisation": "West Midlands Fire Service",
7+
"author": "Jane Doe",
8+
"description": "For ordering delicious pizza",
9+
"categories": []
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// placeholder, here simply so we can resolve the module

0 commit comments

Comments
 (0)