Skip to content

Commit 4593058

Browse files
committed
fix(test): 修复挂掉的测试用例
1 parent 6c0e69c commit 4593058

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

common/utils/createQuestion.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import fs from "fs";
22
import path from "path";
33
import readlinePromises from "node:readline/promises";
44
import {getCountBySameName} from "./getCountBySameName.js";
5+
6+
7+
export const sourceFilePath = path.normalize('./common/template/template.js');
58
export function createQuestion(newPath) {
69
const rl = readlinePromises.createInterface({
710
input: process.stdin,
811
output: process.stdout,
912
});
10-
const sourceFilePath = path.normalize('./common/template/template.js');
1113
return new Promise((resolve, reject) => {
1214
let newDir = path.normalize(`./src/${newPath}`);
1315
let newFilePath = path.join(newDir, 'index.js');

test/graph.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect } from 'vitest';
2-
import Node from "#common/structures/Node";
2+
import { Node } from "#common/structures/Node";
33

44
const graphArray1 = [[2, 4], [1, 3], [2, 4], [1, 3]];
55
const graphArray2 = [[]];

test/listNode.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { test, expect, describe } from 'vitest';
2-
import ListNode from "#common/structures/ListNode";
2+
import { ListNode } from "#common/structures/ListNode";
33

44
test('toArray 正常数组', () => {
55
// 创建链表

test/tree.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {test, expect, describe} from 'vitest';
2-
import TreeNode from "#common/structures/TreeNode";
2+
import { TreeNode } from "#common/structures/TreeNode";
33

44
const mockTree = [1, 2, 3];
55
const mockTree2 = [1,null, 2]

0 commit comments

Comments
 (0)