mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-07 21:15:03 +00:00

Some checks are pending
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2019) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* fix: make real onSave export conditions * fix: remove fix * feat: pass export tests * fix: revert bootstrap changes * feat: reduce num of exports * fix: diag tests
31 lines
1 KiB
Lua
31 lines
1 KiB
Lua
---@brief [[
|
|
--- Tests for export functionalities.
|
|
---@brief ]]
|
|
|
|
local fixtures = require 'spec.fixtures'
|
|
local helpers = require 'spec.helpers'
|
|
|
|
require('tinymist').setup {
|
|
lsp = {
|
|
init_options = {
|
|
exportPdf = 'onSave',
|
|
systemFonts = false,
|
|
},
|
|
}
|
|
}
|
|
|
|
describe('Export', function()
|
|
assert.is.empty(vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
|
|
it('no pdf is created onSave', function()
|
|
vim.cmd.edit(fixtures.project.some_existing_file)
|
|
assert.is.same(1, #vim.lsp.get_clients { bufnr = 0, name = 'tinymist', _uninitialized = true })
|
|
--- append a text to current buffer
|
|
helpers.insert('This is a test export.\n')
|
|
-- sleep 300ms
|
|
vim.cmd.sleep('300m')
|
|
-- there *must not be* a pdf file created, because we only export on save
|
|
local pdf_path = fixtures.project.some_existing_file:gsub('%.typ$', '.pdf')
|
|
assert.is.same(nil, vim.uv.fs_stat(pdf_path), 'PDF file should not be created without saving because exportPdf = onSave')
|
|
end)
|
|
end)
|