Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
The test was rewritten to use `node:test`.
  • Loading branch information
remcohaszing committed Aug 22, 2023
1 parent fa14735 commit 71f7300
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
out/
*.md
.vscode-test/
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 10 additions & 15 deletions test/index.test.js
Original file line number Diff line number Diff line change
@@ -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})
}

0 comments on commit 71f7300

Please sign in to comment.