aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/__snapshots__/formatting.test.js.snap44
-rw-r--r--tests/fixtures/foo.xml19
-rw-r--r--tests/formatting.test.js2
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');