mirror of https://github.com/TriliumNext/Notes
chore(tests): move tests next to actual file
parent
658317799d
commit
49246ee456
@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import attributeParser from "../src/public/app/services/attribute_parser.ts";
|
import attributeParser from "./attribute_parser.js";
|
||||||
|
|
||||||
|
|
||||||
describe("Lexing", () => {
|
describe("Lexing", () => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { expect, describe, it } from "vitest";
|
import { expect, describe, it } from "vitest";
|
||||||
import sanitizeAttributeName from "../src/services/sanitize_attribute_name";
|
import sanitizeAttributeName from "./sanitize_attribute_name.js";
|
||||||
|
|
||||||
// fn value, expected value
|
// fn value, expected value
|
||||||
const testCases: [fnValue: string, expectedValue: string][] = [
|
const testCases: [fnValue: string, expectedValue: string][] = [
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import handleParens from "../../src/services/search/services/handle_parens.js";
|
import handleParens from "./handle_parens.js";
|
||||||
import type { TokenStructure } from "../../src/services/search/services/types.js";
|
import type { TokenStructure } from "./types.js";
|
||||||
|
|
||||||
describe("Parens handler", () => {
|
describe("Parens handler", () => {
|
||||||
it("handles parens", () => {
|
it("handles parens", () => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import lex from "../../src/services/search/services/lex.js";
|
import lex from "./lex.js";
|
||||||
|
|
||||||
describe("Lexer fulltext", () => {
|
describe("Lexer fulltext", () => {
|
||||||
it("simple lexing", () => {
|
it("simple lexing", () => {
|
||||||
@ -1,16 +1,16 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import AndExp from "../../src/services/search/expressions/and.js";
|
import AndExp from "../../search/expressions/and.js";
|
||||||
import AttributeExistsExp from "../../src/services/search/expressions/attribute_exists.js";
|
import AttributeExistsExp from "../../search/expressions/attribute_exists.js";
|
||||||
import type Expression from "../../src/services/search/expressions/expression.js";
|
import type Expression from "../../search/expressions/expression.js";
|
||||||
import LabelComparisonExp from "../../src/services/search/expressions/label_comparison.js";
|
import LabelComparisonExp from "../../search/expressions/label_comparison.js";
|
||||||
import NotExp from "../../src/services/search/expressions/not.js";
|
import NotExp from "../../search/expressions/not.js";
|
||||||
import NoteContentFulltextExp from "../../src/services/search/expressions/note_content_fulltext.js";
|
import NoteContentFulltextExp from "../../search/expressions/note_content_fulltext.js";
|
||||||
import NoteFlatTextExp from "../../src/services/search/expressions/note_flat_text.js";
|
import NoteFlatTextExp from "../../search/expressions/note_flat_text.js";
|
||||||
import OrExp from "../../src/services/search/expressions/or.js";
|
import OrExp from "../../search/expressions/or.js";
|
||||||
import OrderByAndLimitExp from "../../src/services/search/expressions/order_by_and_limit.js";
|
import OrderByAndLimitExp from "../../search/expressions/order_by_and_limit.js";
|
||||||
import PropertyComparisonExp from "../../src/services/search/expressions/property_comparison.js";
|
import PropertyComparisonExp from "../../search/expressions/property_comparison.js";
|
||||||
import SearchContext from "../../src/services/search/search_context.js";
|
import SearchContext from "../../search/search_context.js";
|
||||||
import { default as parseInternal, type ParseOpts } from "../../src/services/search/services/parse.js";
|
import { default as parseInternal, type ParseOpts } from "./parse.js";
|
||||||
|
|
||||||
describe("Parser", () => {
|
describe("Parser", () => {
|
||||||
it("fulltext parser without content", () => {
|
it("fulltext parser without content", () => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { expect, describe, it } from "vitest";
|
import { expect, describe, it } from "vitest";
|
||||||
import { formatDownloadTitle } from "../../src/services/utils.ts";
|
import { formatDownloadTitle } from "./utils.js";
|
||||||
|
|
||||||
const testCases: [fnValue: Parameters<typeof formatDownloadTitle>, expectedValue: ReturnType<typeof formatDownloadTitle>][] = [
|
const testCases: [fnValue: Parameters<typeof formatDownloadTitle>, expectedValue: ReturnType<typeof formatDownloadTitle>][] = [
|
||||||
// empty fileName tests
|
// empty fileName tests
|
||||||
Loading…
Reference in New Issue