Skip to content

Commit

Permalink
[INTERNAL] lbt tests: Fix variable naming 'parseJS' => 'parseUtils'
Browse files Browse the repository at this point in the history
Follow-up of #615
  • Loading branch information
RandomByte committed Jun 16, 2021
1 parent c3d50e3 commit 0594ba7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions test/lib/lbt/analyzer/FioriElementsAnalyzer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const test = require("ava");
const FioriElementsAnalyzer = require("../../../../lib/lbt/analyzer/FioriElementsAnalyzer");
const sinon = require("sinon");
const parseJS = require("../../../../lib/lbt/utils/parseUtils");
const parseUtils = require("../../../../lib/lbt/utils/parseUtils");

test("analyze: with Component.js", async (t) => {
const emptyPool = {};
Expand Down Expand Up @@ -143,7 +143,7 @@ test.serial("_analyzeTemplateComponent: Manifest with TemplateAssembler code", a
const analyzer = new FioriElementsAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("mytpl");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony",
{}, moduleInfo);
Expand Down Expand Up @@ -177,7 +177,7 @@ test.serial("_analyzeTemplateComponent: no default template name", async (t) =>
const analyzer = new FioriElementsAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony",
{}, moduleInfo);
Expand Down Expand Up @@ -206,7 +206,7 @@ test.serial("_analyzeTemplateComponent: with template name from pageConfig", asy
const analyzer = new FioriElementsAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony", {
component: {
Expand Down Expand Up @@ -239,7 +239,7 @@ test("_analyzeAST: get template name from ast", async (t) => {
"manifest": "json"
}
});});`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);

const analyzer = new FioriElementsAnalyzer();

Expand Down Expand Up @@ -269,7 +269,7 @@ test("_analyzeAST: no template name from ast", async (t) => {
"manifest": "json"
}
});});`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);

const analyzer = new FioriElementsAnalyzer();

Expand Down Expand Up @@ -297,7 +297,7 @@ test("_analyzeTemplateClassDefinition: get template name from metadata", async (
"manifest": "json"
}
};`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);
const expression = ast.body[0].declarations[0].init;

const analyzer = new FioriElementsAnalyzer();
Expand All @@ -319,7 +319,7 @@ test("_analyzeTemplateClassDefinition: no string template name from metadata", a
"manifest": "json"
}
};`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);
const expression = ast.body[0].declarations[0].init;

const analyzer = new FioriElementsAnalyzer();
Expand Down
20 changes: 10 additions & 10 deletions test/lib/lbt/analyzer/SmartTemplateAnalyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const test = require("ava");
const SmartTemplateAnalyzer = require("../../../../lib/lbt/analyzer/SmartTemplateAnalyzer");
const ModuleInfo = require("../../../../lib/lbt/resources/ModuleInfo");
const sinon = require("sinon");
const parseJS = require("../../../../lib/lbt/utils/parseUtils");
const parseUtils = require("../../../../lib/lbt/utils/parseUtils");


test("analyze: with Component.js", async (t) => {
Expand Down Expand Up @@ -210,7 +210,7 @@ test.serial("_analyzeTemplateComponent: Manifest with TemplateAssembler code", a
const analyzer = new SmartTemplateAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("mytpl");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony",
{}, moduleInfo);
Expand Down Expand Up @@ -247,7 +247,7 @@ test.serial("_analyzeTemplateComponent: no default template name", async (t) =>
const analyzer = new SmartTemplateAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony",
{}, moduleInfo);
Expand Down Expand Up @@ -279,7 +279,7 @@ test.serial("_analyzeTemplateComponent: with template name from pageConfig", asy
const analyzer = new SmartTemplateAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony", {
component: {
Expand Down Expand Up @@ -316,7 +316,7 @@ test.serial("_analyzeTemplateComponent: dependency not found", async (t) => {
const analyzer = new SmartTemplateAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

const error = await t.throwsAsync(analyzer._analyzeTemplateComponent("pony", {
component: {
Expand Down Expand Up @@ -353,7 +353,7 @@ test.serial("_analyzeTemplateComponent: dependency not found is ignored", async
const analyzer = new SmartTemplateAnalyzer(mockPool);

const stubAnalyzeAST = sinon.stub(analyzer, "_analyzeAST").returns("");
const stubParse = sinon.stub(parseJS, "parseJS").returns("");
const stubParse = sinon.stub(parseUtils, "parseJS").returns("");

await analyzer._analyzeTemplateComponent("pony", {
component: {
Expand Down Expand Up @@ -385,7 +385,7 @@ test("_analyzeAST: get template name from ast", async (t) => {
"manifest": "json"
}
});});`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);

const analyzer = new SmartTemplateAnalyzer();

Expand Down Expand Up @@ -416,7 +416,7 @@ test("_analyzeAST: no template name from ast", async (t) => {
"manifest": "json"
}
});});`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);

const analyzer = new SmartTemplateAnalyzer();

Expand Down Expand Up @@ -489,7 +489,7 @@ test("_analyzeTemplateClassDefinition: get template name from metadata", async (
"manifest": "json"
}
};`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);
const expression = ast.body[0].declarations[0].init;

const analyzer = new SmartTemplateAnalyzer();
Expand All @@ -511,7 +511,7 @@ test("_analyzeTemplateClassDefinition: no string template name from metadata", a
"manifest": "json"
}
};`;
const ast = parseJS.parseJS(code);
const ast = parseUtils.parseJS(code);
const expression = ast.body[0].declarations[0].init;

const analyzer = new SmartTemplateAnalyzer();
Expand Down

0 comments on commit 0594ba7

Please sign in to comment.