diff --git a/.prettierignore b/.prettierignore index 61182fc..dd44972 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1 @@ -out/ *.md -.vscode-test/ diff --git a/package.json b/package.json index d6b425d..ce4c324 100644 --- a/package.json +++ b/package.json @@ -33,18 +33,19 @@ "vscode": "^1.67.0" }, "devDependencies": { + "@types/node": "^20.0.0", "@types/vscode": "^1.0.0", "@vscode/test-electron": "^2.0.0", "@vscode/vsce": "^2.0.0", - "esbuild": "^0.16.0", - "ovsx": "^0.7.0", - "prettier": "^2.0.0", + "esbuild": "^0.19.0", + "ovsx": "^0.8.0", + "prettier": "^3.0.0", "remark-cli": "^11.0.0", "remark-language-server": "^2.0.0", "remark-preset-wooorm": "^9.0.0", - "typescript": "^4.0.0", + "typescript": "^5.0.0", "vscode-languageclient": "^8.0.0", - "xo": "^0.53.0" + "xo": "^0.56.0" }, "scripts": { "vscode:prepublish": "npm run build", diff --git a/test/index.test.js b/test/index.test.js index 55e2f49..4f39a9d 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,28 +1,23 @@ -const assert = require('node:assert') +const assert = require('node:assert/strict') const fs = require('node:fs/promises') const path = require('node:path') - +const {test} = require('node:test') const {commands, extensions, window, workspace} = require('vscode') module.exports.run = async () => { const filePath = path.join(__dirname, 'test.md') - try { - const ext = extensions.getExtension('unifiedjs.vscode-remark') - await ext?.activate() + const ext = extensions.getExtension('unifiedjs.vscode-remark') + await ext?.activate() + + await test('use the language server', async () => { await fs.writeFile(filePath, '- remark\n- lsp\n- vscode\n') const doc = await workspace.openTextDocument(filePath) await window.showTextDocument(doc) await commands.executeCommand('editor.action.formatDocument') - assert.equal( - doc.getText(), - '* remark\n* lsp\n* vscode\n', - 'format document' - ) - } catch (error) { - throw error - } finally { - await fs.rm(filePath) - } + assert.equal(doc.getText(), '* remark\n* lsp\n* vscode\n') + }) + + await fs.rm(filePath, {force: true}) }