-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-previewFeatures-option
- Loading branch information
Showing
25 changed files
with
963 additions
and
965 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/mocharc", | ||
"parallel": true, | ||
"spec": ["source/**/__tests__/*.test.js"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
...output/__tests__/describeNameText.test.ts → ...output/__tests__/describeNameText.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { describe, expect, test } from "@jest/globals"; | ||
import { Scribbler } from "#scribbler"; | ||
import { describeNameText } from "../describeNameText.js"; | ||
import { expect } from "chai"; | ||
import { describe, test } from "mocha"; | ||
import { describeNameText, Scribbler } from "tstyche/tstyche"; | ||
|
||
const scribbler = new Scribbler(); | ||
|
||
describe("describeNameText", () => { | ||
test("describe name text", () => { | ||
const text = scribbler.render(describeNameText("sample describe name")); | ||
|
||
expect(text).toMatchInlineSnapshot(` | ||
" sample describe name | ||
" | ||
`); | ||
expect(text).to.equal([ | ||
" sample describe name", | ||
"", | ||
].join("\n")); | ||
}); | ||
|
||
test("describe name text with indent", () => { | ||
const text = scribbler.render(describeNameText("sample describe name", 2)); | ||
|
||
expect(text).toMatchInlineSnapshot(` | ||
" sample describe name | ||
" | ||
`); | ||
expect(text).to.equal([ | ||
" sample describe name", | ||
"", | ||
].join("\n")); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { expect } from "chai"; | ||
import { describe, test } from "mocha"; | ||
import prettyAnsi from "pretty-ansi"; | ||
import { Diagnostic, diagnosticText, Scribbler } from "tstyche/tstyche"; | ||
|
||
const scribbler = new Scribbler(); | ||
|
||
describe("diagnosticText", () => { | ||
test("formats diagnostic text", () => { | ||
const text = scribbler.render(diagnosticText(Diagnostic.error("sample text"))); | ||
|
||
expect(prettyAnsi(text)).to.equal([ | ||
"<red>Error: </>sample text", | ||
"", | ||
"", | ||
].join("\n")); | ||
}); | ||
|
||
test("formats diagnostic text with more than two lines", () => { | ||
const text = scribbler.render(diagnosticText(Diagnostic.error(["sample text", "with more than", "two lines"]))); | ||
|
||
expect(prettyAnsi(text)).to.equal([ | ||
"<red>Error: </>sample text", | ||
"", | ||
"with more than", | ||
"two lines", | ||
"", | ||
"", | ||
].join("\n")); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
44 changes: 22 additions & 22 deletions
44
...ce/output/__tests__/formattedText.test.ts → ...ce/output/__tests__/formattedText.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import { describe, expect, test } from "@jest/globals"; | ||
import { Scribbler } from "#scribbler"; | ||
import { formattedText } from "../formattedText.js"; | ||
import { expect } from "chai"; | ||
import { describe, test } from "mocha"; | ||
import { formattedText, Scribbler } from "tstyche/tstyche"; | ||
|
||
const scribbler = new Scribbler(); | ||
|
||
describe("formattedText", () => { | ||
test("formats string", () => { | ||
const string = scribbler.render(formattedText("1.2.3")); | ||
|
||
expect(string).toMatchInlineSnapshot(` | ||
"1.2.3 | ||
" | ||
`); | ||
expect(string).to.equal([ | ||
"1.2.3", | ||
"", | ||
].join("\n")); | ||
}); | ||
|
||
test("formats list", () => { | ||
const list = scribbler.render(formattedText(["path/to/first.test.ts", "path/to/second.test.ts"])); | ||
|
||
expect(list).toMatchInlineSnapshot(` | ||
"[ | ||
"path/to/first.test.ts", | ||
"path/to/second.test.ts" | ||
] | ||
" | ||
`); | ||
expect(list).to.equal([ | ||
"[", | ||
' "path/to/first.test.ts",', | ||
' "path/to/second.test.ts"', | ||
"]", | ||
"", | ||
].join("\n")); | ||
}); | ||
|
||
test("formats object", () => { | ||
// eslint-disable-next-line sort-keys -- testing purpose | ||
const record = scribbler.render(formattedText({ k: "keys", a: "all", s: "sorted" })); | ||
|
||
expect(record).toMatchInlineSnapshot(` | ||
"{ | ||
"a": "all", | ||
"k": "keys", | ||
"s": "sorted" | ||
} | ||
" | ||
`); | ||
expect(record).to.equal([ | ||
"{", | ||
' "a": "all",', | ||
' "k": "keys",', | ||
' "s": "sorted"', | ||
"}", | ||
"", | ||
].join("\n")); | ||
}); | ||
}); |
Oops, something went wrong.