-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from vscodeshift/fix/tabs
fix: use editor tab settings
- Loading branch information
Showing
4 changed files
with
103 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,48 @@ | ||
// You can import and use all API from the 'vscode' module | ||
// as well as import your extension to test it | ||
import * as vscode from 'vscode' | ||
import { expect } from 'chai' | ||
|
||
suite('Extension Test Suite', () => { | ||
vscode.window.showInformationMessage('Start all tests.') | ||
test('extension.cssToJss command', async function() { | ||
const document = await vscode.workspace.openTextDocument( | ||
vscode.Uri.parse('untitled:test.js') | ||
) | ||
const editor = await vscode.window.showTextDocument(document) | ||
editor.options.tabSize = 2 | ||
editor.options.insertSpaces = true | ||
await editor.edit(edit => | ||
edit.insert( | ||
document.positionAt(0), | ||
`{ | ||
body { | ||
margin: 0; | ||
overflow: hidden; | ||
display: flex; | ||
height: 100vh; | ||
background: black; | ||
} | ||
} | ||
` | ||
) | ||
) | ||
editor.selection = new vscode.Selection( | ||
new vscode.Position(1, 2), | ||
new vscode.Position(7, 3) | ||
) | ||
await vscode.commands.executeCommand('extension.cssToJss') | ||
|
||
expect(document.getText()).to.equal(`{ | ||
'@global': { | ||
body: { | ||
margin: '0', | ||
overflow: 'hidden', | ||
display: 'flex', | ||
height: '100vh', | ||
background: 'black' | ||
} | ||
}, | ||
} | ||
`) | ||
}) | ||
}) |
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