Skip to content

Commit

Permalink
kozakdenys#17 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Kozak committed May 27, 2021
1 parent 7fa3f84 commit e7168c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/figures/dot/canvas/QRDot.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("Test QRDot class", () => {

it("Should draw simple square dot", () => {
const dotSize = 50;
const imgFile = fs.readFileSync(path.resolve(__dirname, "../assets/test/simple_square_dot.png"), "base64");
const imgFile = fs.readFileSync(path.resolve(__dirname, "../../../assets/test/simple_square_dot.png"), "base64");
const dot = new QRDot({ context: canvasContext, type: "square" });
dot.draw(dotSize / 2, dotSize / 2, dotSize, () => false);
canvasContext.fill("evenodd");
Expand All @@ -36,7 +36,7 @@ describe("Test QRDot class", () => {

it("Should draw simple dots", () => {
const dotSize = 40;
const imgFile = fs.readFileSync(path.resolve(__dirname, "../assets/test/simple_dots.png"), "base64");
const imgFile = fs.readFileSync(path.resolve(__dirname, "../../../assets/test/simple_dots.png"), "base64");
const dot = new QRDot({ context: canvasContext, type: "dots" });
dot.draw(10, 30, dotSize, () => false);
dot.draw(50, 30, dotSize, () => false);
Expand All @@ -53,7 +53,7 @@ describe("Test QRDot class", () => {
[0, 1, 0, 1, 1],
[0, 0, 1, 0, 0],
];
const imgFile = fs.readFileSync(path.resolve(__dirname, "../assets/test/rounded_dots.png"), "base64");
const imgFile = fs.readFileSync(path.resolve(__dirname, "../../../assets/test/rounded_dots.png"), "base64");
const dot = new QRDot({ context: canvasContext, type: "rounded" });

for (let y = 0; y < matrix.length; y++) {
Expand Down
5 changes: 3 additions & 2 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as index from "./index";
describe("Index", () => {
it.each(["dotTypes", "errorCorrectionLevels", "errorCorrectionPercents", "modes", "qrTypes", "default"])(
"The module should export certain submodules",
moduleName => {
(moduleName) => {
expect(Object.keys(index)).toContain(moduleName);
});
}
);
});

0 comments on commit e7168c1

Please sign in to comment.