Major refactor (#18381)
This commit is contained in:
1 parent
45a738c7c0
commit
e240f15e75
350 files changed
+1374
-1283
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { getDescendants } from "../../src/utils/ast-utils.js";
|
||||
import { getDescendants } from "../../src/utilities/ast.js";
|
||||
|
||||
const tree = {
|
||||
id: "tree",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ConfigError } from "../../src/common/errors.js";
|
||||
import { getParserPluginByParserName } from "../../src/main/parser-and-printer.js";
|
||||
import createPlugin from "../config/utils/create-plugin.cjs";
|
||||
import createPlugin from "../config/utilities/create-plugin.cjs";
|
||||
|
||||
describe("unit tests for getParserPluginByParserName", () => {
|
||||
const getMockPlugins = (name) => [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ConfigError } from "../../src/common/errors.js";
|
||||
import { getPrinterPluginByAstFormat } from "../../src/main/parser-and-printer.js";
|
||||
import createPlugin from "../config/utils/create-plugin.cjs";
|
||||
import createPlugin from "../config/utilities/create-plugin.cjs";
|
||||
|
||||
describe("unit tests for getPrinterPluginByAstFormat", () => {
|
||||
const getMockPlugins = (name) => [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import makeString from "../../src/utils/make-string.js";
|
||||
import makeString from "../../src/utilities/make-string.js";
|
||||
|
||||
const DOUBLE_QUOTE = '"';
|
||||
const SINGLE_QUOTE = "'";
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
import WhitespaceUtils from "../../src/utils/whitespace-utils.js";
|
||||
import WhitespaceUtilities from "../../src/utilities/whitespace-utilities.js";
|
||||
|
||||
it("constructor", () => {
|
||||
expect(() => new WhitespaceUtils()).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils(1)).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils("")).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils([])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils([""])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils(["a"])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils("a")).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtils(["\r\n"])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities()).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities(1)).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities("")).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities([])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities([""])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities(["a"])).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities("a")).toThrow(TypeError);
|
||||
expect(() => new WhitespaceUtilities(["\r\n"])).toThrow(TypeError);
|
||||
|
||||
expect(new WhitespaceUtils("\r\n")).toBeInstanceOf(WhitespaceUtils);
|
||||
expect(new WhitespaceUtils(["\r", "\n"])).toBeInstanceOf(WhitespaceUtils);
|
||||
expect(new WhitespaceUtilities("\r\n")).toBeInstanceOf(WhitespaceUtilities);
|
||||
expect(new WhitespaceUtilities(["\r", "\n"])).toBeInstanceOf(
|
||||
WhitespaceUtilities,
|
||||
);
|
||||
});
|
||||
|
||||
const utils = new WhitespaceUtils(" ");
|
||||
const utils = new WhitespaceUtilities(" ");
|
||||
describe("trimStart", () => {
|
||||
for (const [string, expected] of [
|
||||
["", ""],
|
||||
Reference in new issue
Block a user