Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
moved default for stackFileName up to top level createOrAddToStacksUs…
Browse files Browse the repository at this point in the history
…ingFileSystem

added TypeScript NPM script
  • Loading branch information
Graham Dyson committed Feb 18, 2020
1 parent 4adef6c commit 22a02e9
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jsconfig.json
Expand Up @@ -9,6 +9,6 @@
"target": "es2017"
},
"exclude": [
"node_modules"
"test-coverage"
]
}
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Expand Up @@ -20,7 +20,8 @@
"cspell": "4.0.21",
"eslint": "6.5.1",
"eslint-plugin-notice": "0.8.9",
"jest": "24.9.0"
"jest": "24.9.0",
"typescript": "3.7.5"
},
"homepage": "https://github.com/DevSnicket/Eunice#readme",
"jest": {
Expand Down Expand Up @@ -63,12 +64,13 @@
"url": "https://github.com/DevSnicket/eunice-processors.git"
},
"scripts": {
"all": "npm run spellcheck && npm run lint && npm run test",
"all": "npm run spellcheck && npm run lint && npm run test && npm run typescript",
"eunice": "npx eunice --accept-license --ignore-path-pattern=\"(^|/)(\\..*|node_modules|test-coverage)$\" --output-yaml --reverse-file-content=false",
"lint": "npx eslint .",
"spellcheck": "find -type f \\( -name \"*.js\" -or -name \"*.md\" \\) ! -path \"./node_modules/**/*\" ! -path \"./test-coverage/**/*\" -exec npx cspell {} +",
"test": "npx jest"
"test": "npx jest",
"typescript": "npx tsc -p jsconfig.json"
},
"type": "module",
"version": "14.0.0"
"version": "14.1.0"
}
1 change: 1 addition & 0 deletions replacement/replaceDependsUpon/index.test.js
Expand Up @@ -75,6 +75,7 @@ test.each(
],
)(
"%j and replacement of %o calls replace with argument %o and returns %j",
// @ts-ignore
(identifierOrItemOrLevelOrStack, replacement, replaceCallArgument, expected) => {
const replace = jest.fn(() => replacement);

Expand Down
1 change: 1 addition & 0 deletions replacement/replaceIdentifiersAndItems/index.test.js
Expand Up @@ -82,6 +82,7 @@ describe(
],
)(
"%s",
// @ts-ignore
(description, identifierOrItemOrLevelOrStack, replaceCallArguments) => {
const replace = jest.fn(({ identifierOrItem }) => identifierOrItem);

Expand Down
Expand Up @@ -55,9 +55,11 @@ test.each(
],
)(
"%j with replacement %j returns %j",
// @ts-ignore
(argument, expected) =>
expect(
replaceIdentifiersAndItemsAndLevelsAndStacks(
// @ts-ignore
argument,
),
)
Expand Down Expand Up @@ -147,6 +149,7 @@ test.each(
],
)(
"%j calls replace with arguments %j",
// @ts-ignore
(identifierOrItemOrLevelOrStack, expected) => {
const actual = [];

Expand Down
Expand Up @@ -68,6 +68,7 @@ describe(
],
)(
"Ancestors of %j returns %j",
// @ts-ignore
(ancestors, expected) =>
expect(
hasParentInAncestors({
Expand Down
Expand Up @@ -8,7 +8,7 @@ import path from "path";
export default ({
ancestors,
directory,
stackFileName = ".eunice-stack.yaml",
stackFileName,
subsetIdentifierHierarchy,
}) => {
const ancestorIdentifiers =
Expand Down
Expand Up @@ -81,12 +81,15 @@ test.each(
],
)(
"%j ancestors with subset identifier hierarchy %j returns %j",
// @ts-ignore
(ancestors, subsetIdentifierHierarchy, expected) =>
expect(
getTargetLevelOrStackForAncestorsAndDirectory({
ancestors,
directory:
path.join(__dirname, "testCases"),
stackFileName:
".eunice-stack.yaml",
subsetIdentifierHierarchy,
}),
)
Expand Down
2 changes: 1 addition & 1 deletion stacking/createOrAddToStacksUsingFileSystem/index.js
Expand Up @@ -8,7 +8,7 @@ export default ({
addNewInTarget = true,
directory,
identifierOrItemOrLevelOrStack,
stackFileName,
stackFileName = ".eunice-stack.yaml",
subsetIdentifierHierarchy,
}) =>
replaceIdentifiersAndItemsAndLevelsAndStacks({
Expand Down
Expand Up @@ -6,7 +6,11 @@ import getIdentifierOrIdentifierOfItem from "../getIdentifierOrIdentifierOfItem"

export default
levelOrStack => {
const itemsByIdentifier = new Map(generateKeyValuePairs());
const itemsByIdentifier =
new Map(
// @ts-ignore
generateKeyValuePairs(),
);

return (
{
Expand Down
Expand Up @@ -18,8 +18,12 @@ identifierOrItemOrLevelOrStack => {
!identifierOrItemOrLevelOrStack
&&
{
getIdentifiersNotUsed: () => null,
useItem: () => null,
getIdentifiersNotUsed:
() => null,
useItem:
// match other definition
// eslint-disable-next-line no-unused-vars
identifierOrItem => null,
}
);
}
Expand Down
Expand Up @@ -99,7 +99,9 @@ describe(
],
)(
"%j returns %j",
// @ts-ignore
(
// @ts-ignore
{ identifierOrItemOrLevelOrStack, targetIdentifierOrItem },
existing,
) =>
Expand Down Expand Up @@ -147,6 +149,7 @@ describe(
],
)(
"%j returns %j",
// @ts-ignore
(
identifierOrItemOrLevelOrStack,
identifiersNotUsed,
Expand Down
Expand Up @@ -77,6 +77,7 @@ test.each(
],
)(
"%j returns %j",
// @ts-ignore
(targetLevelOrStack, expected) =>
expect(getIdentifiersInTargetLevelOrStack(targetLevelOrStack))
.toEqual(expected),
Expand Down
Expand Up @@ -58,7 +58,9 @@ test.each(
],
)(
"%j returns %j",
// @ts-ignore
(
// @ts-ignore
{ identifierOrItemOrLevelOrStack, targetLevelOrStack },
existing,
) =>
Expand Down
Expand Up @@ -78,6 +78,7 @@ describe(
],
)(
"returns %s",
// @ts-ignore
(returnDescription, itemOrLevelOrStack) =>
expect(
mapTargetLevelOrStack({
Expand Down
Expand Up @@ -71,6 +71,7 @@ describe(
],
)(
"Target of %j, throws error message of %s.",
// @ts-ignore
(targetLevelOrStack, targetDescription) =>
expect(
() =>
Expand Down

0 comments on commit 22a02e9

Please sign in to comment.