-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rule): add "disabled" and "allows" for each dict item (#15)
* feat(rule): add "disabled" and "allows" for each dict item * chore(rule): add JSdoc * docs(rule): ルールの説明文を修正 * fix typo
- Loading branch information
Showing
8 changed files
with
366 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// MIT © 2019 azu | ||
"use strict"; | ||
import assert from "assert"; | ||
|
||
describe('dictionary', function() { | ||
it("should not have duplicated id", () => { | ||
const dictionary = require("../src/dictionary.js"); | ||
dictionary.forEach(item => { | ||
assert.ok(typeof item.id === "string", "should have id property"); | ||
const sameIdItems = dictionary.filter(target => target.id === item.id); | ||
assert.ok(sameIdItems.length === 1, "should not have duplicated id item"); | ||
}); | ||
}); | ||
it("should have disabled default value", () => { | ||
const dictionary = require("../src/dictionary.js"); | ||
dictionary.forEach(item => { | ||
assert.ok(typeof item.disabled === "boolean", `${item} should have disabled property`); | ||
}); | ||
}); | ||
it("should have allows default value", () => { | ||
const dictionary = require("../src/dictionary.js"); | ||
dictionary.forEach(item => { | ||
assert.ok(Array.isArray(item.allows), `${item}: should have disabled property`); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.