Skip to content
This repository was archived by the owner on May 1, 2023. It is now read-only.

Commit fceff2d

Browse files
committed
test: add test for opening tag with whitespace
Close #2
1 parent a7ac46c commit fceff2d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

__tests__/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,27 @@ echo "foo bar";
4242
*
4343
* Copyright (c) 2018 Splish UG (haftungsbeschränkt)
4444
*/
45+
echo "foo bar";
46+
`)
47+
})
48+
49+
test('does start with <?php (w/ unnecessary whitespace after opening tag)', () => {
50+
const input = `<?php
51+
52+
53+
echo "foo bar";
54+
`
55+
const [status, output] = getUpdatedCopyrightHeader(input, php, options)
56+
57+
expect(status).toEqual(CopyrightHeaderStatus.Added)
58+
expect(output).toEqual(`<?php
59+
/**
60+
* This file is part of @splish-me/copyright-headers
61+
*
62+
* Copyright (c) 2018 Splish UG (haftungsbeschränkt)
63+
*/
64+
65+
4566
echo "foo bar";
4667
`)
4768
})

0 commit comments

Comments
 (0)