Add test
This commit is contained in:
parent
16f35b3485
commit
fc75efa9ad
2 changed files with 79 additions and 0 deletions
48
src/test/fixtures/readme/readme.branch.expected.md
vendored
Normal file
48
src/test/fixtures/readme/readme.branch.expected.md
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
# README
|
||||
|
||||
>**Important:** Once installed the checker will only update if you add the setting `"spellMD.enable": true` to your `.vscode\settings.json` file.
|
||||
|
||||
This README covers off:
|
||||
* [Functionality](#functionality)
|
||||
* [Install](#install)
|
||||
* [Run and Configure](#run-and-configure)
|
||||
* [Known Issues/Bugs](#known-issuesbugs)
|
||||
* [Backlog](#backlog)
|
||||
* [How to Debug](#how-to-debug)
|
||||
|
||||
# Functionality
|
||||
|
||||
Load up a Markdown file and get highlights and hovers for existing issues. Checking will occur as you type in the document.
|
||||
|
||||
![Underscores and hovers](https://github.com/username/repository/raw/master/images/SpellMDDemo1.gif)
|
||||
|
||||
The status bar lets you quickly navigate to any issue and you can see all positions in the gutter.
|
||||
|
||||
[![Jump to issues](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif)](http://shouldnottouchthis/)
|
||||
[![Jump to issues](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif)](https://github.com/username/repository/blob/main/monkey)
|
||||
![](https://github.com/username/repository/raw/master/images/SpellMDDemo2.gif)
|
||||
<img src="https://github.com/username/repository/raw/master/images/myImage.gif">
|
||||
|
||||
The `spellMD.json` config file is watched so you can add more ignores or change mappings at will.
|
||||
|
||||
![Add to dictionary](https://github.com/username/repository/raw/master/images/SpellMDDemo3.gif)
|
||||
|
||||
![issue](https://github.com/username/repository/raw/master/issue)
|
||||
|
||||
[mono](https://github.com/username/repository/blob/main/monkey)
|
||||
[not](http://shouldnottouchthis/)
|
||||
[Email me](mailto:example@example.com)
|
||||
|
||||
# Install
|
||||
This extension is published in the VS Code Gallery. So simply hit 'F1' and type 'ext inst' from there select `SpellMD` and follow instructions.
|
||||
|
||||
|
||||
To clone the extension and load locally...
|
||||
|
||||
```
|
||||
git clone https://github.com/Microsoft/vscode-SpellMD.git
|
||||
npm install
|
||||
tsc
|
||||
```
|
||||
|
||||
>**Note:** TypeScript 1.6 or higher is required you can check with `tsc -v` and if you need to upgrade then run `npm install -g typescript`.
|
|
@ -1466,6 +1466,37 @@ describe('MarkdownProcessor', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('should respect specified GitHub branch and can be overriden', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
publisher: 'mocha',
|
||||
version: '0.0.1',
|
||||
description: 'test extension',
|
||||
engines: Object.create(null),
|
||||
repository: 'https://github.com/username/repository'
|
||||
};
|
||||
|
||||
const root = fixture('readme');
|
||||
const processor = new ReadmeProcessor(manifest, {
|
||||
githubBranch: 'main',
|
||||
// Override image relative links to point to different base URL
|
||||
baseImagesUrl: 'https://github.com/username/repository/raw/master'
|
||||
});
|
||||
const readme = {
|
||||
path: 'extension/readme.md',
|
||||
localPath: path.join(root, 'readme.md')
|
||||
};
|
||||
|
||||
return processor.onFile(readme)
|
||||
.then(file => read(file))
|
||||
.then(actual => {
|
||||
return readFile(path.join(root, 'readme.branch.expected.md'), 'utf8')
|
||||
.then(expected => {
|
||||
assert.equal(actual, expected);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should infer baseContentUrl if its a github repo (.git)', () => {
|
||||
const manifest = {
|
||||
name: 'test',
|
||||
|
|
Loading…
Add table
Reference in a new issue