diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2020-02-15 09:49:17 +0000 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2020-02-15 09:49:17 +0000 |
| commit | 66c1a7c8fcba6ef118469e0845ddd8638069d35a (patch) | |
| tree | 9c4e41a1c0cec3f49f3e53b7a83c3dc7dc2f5f0f /tests | |
| parent | 8373441047299fbe528dfda528fa01a4971e7d23 (diff) | |
| download | vim-prettier-66c1a7c8fcba6ef118469e0845ddd8638069d35a.tar.xz | |
Added support for prettier xml plugin
- updated package.json deps
- added tests
- updated lock file
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/__snapshots__/formatting.test.js.snap | 44 | ||||
| -rw-r--r-- | tests/fixtures/foo.xml | 19 | ||||
| -rw-r--r-- | tests/formatting.test.js | 2 |
3 files changed, 64 insertions, 1 deletions
diff --git a/tests/__snapshots__/formatting.test.js.snap b/tests/__snapshots__/formatting.test.js.snap index cfa24bf..fafb3e7 100644 --- a/tests/__snapshots__/formatting.test.js.snap +++ b/tests/__snapshots__/formatting.test.js.snap @@ -282,6 +282,50 @@ export default { </custom1>" `; +exports[`Prettier formats foo.xml file with :Prettier command 1`] = ` +"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\" ?> +<!DOCTYPE module PUBLIC \\"-//Puppy Crawl//DTD Check Configuration 1.3//EN\\" + \\"https://www.puppycrawl.com/dtds/configuration_1_3.dtd\\"> +<?xml-model href=\\"project.rnc\\" type=\\"application/relax-ng-compact-syntax\\"?> +<!-- foo --> +<svg + xmlns=\\"http://www.w3.org/2000/svg\\" + xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" + width=\\"200\\" + height=\\"100\\" + viewBox=\\"0 0 200 100\\" +> + <title>foo</title> + <desc _attr=\\"attr\\"> + bar + </desc> + <style /> +</svg> +<!-- bar -->" +`; + +exports[`Prettier formats foo.xml file with :PrettierAsync command 1`] = ` +"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\" ?> +<!DOCTYPE module PUBLIC \\"-//Puppy Crawl//DTD Check Configuration 1.3//EN\\" + \\"https://www.puppycrawl.com/dtds/configuration_1_3.dtd\\"> +<?xml-model href=\\"project.rnc\\" type=\\"application/relax-ng-compact-syntax\\"?> +<!-- foo --> +<svg + xmlns=\\"http://www.w3.org/2000/svg\\" + xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" + width=\\"200\\" + height=\\"100\\" + viewBox=\\"0 0 200 100\\" +> + <title>foo</title> + <desc _attr=\\"attr\\"> + bar + </desc> + <style /> +</svg> +<!-- bar -->" +`; + exports[`Prettier formats foo.yaml file with :Prettier command 1`] = ` "foo: bar: diff --git a/tests/fixtures/foo.xml b/tests/fixtures/foo.xml new file mode 100644 index 0000000..93d6e9b --- /dev/null +++ b/tests/fixtures/foo.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "https://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + <?xml-model href="project.rnc" type="application/relax-ng-compact-syntax"?> +<!-- foo --> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="200" + height="100" + viewBox="0 0 200 100" +> + <title>foo</title> + <desc _attr="attr"> + bar + </desc> + <style></style> +</svg> +<!-- bar --> diff --git a/tests/formatting.test.js b/tests/formatting.test.js index 2a3e373..4ea2906 100644 --- a/tests/formatting.test.js +++ b/tests/formatting.test.js @@ -10,7 +10,7 @@ const FIXTURES_DIR = `${__dirname}/fixtures`; let server; let remote; -jest.setTimeout(10000); +jest.setTimeout(15000); const getBufferContents = async remote => (await remote.call('getline', [1, '$'])).join('\n'); |
