Skip to content

Commit af939ff

Browse files
Merge pull request #567 from elsassph/fix/playwright
Fix playwright tests
2 parents 3ba0d42 + e4b234c commit af939ff

File tree

9 files changed

+23
-13
lines changed

9 files changed

+23
-13
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@ The Lightning is an open source project. If you want to contribute to it, please
3131
Before you submit your PR, make sure you install the projects dependencies, as this will activate automatic
3232
linting and code formatting in a Git commit hook.
3333

34+
## Testing
35+
36+
Make sure changes and new code are covered with unit tests or/and integration tests.
37+
38+
### Unit tests (vitest)
39+
40+
Test files are under `src/` with a `.test.mjs` or `.test.mts` extension.
41+
42+
```
43+
npm run test
44+
```
45+
46+
### Integration tests (Playwright)
47+
48+
Test cases are under `tests/` and use either the ES5 build output or directly point to `.mjs` files (TypeScript won't run in the browser).
49+
50+
```
51+
npx playwright install
52+
npm run build
53+
npm run playwright:interactive
54+
```
55+
3456
## Changelog
3557

3658
Checkout the changelog [here](./CHANGELOG.md).

tests/event-emitter/test.event-emitter.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
describe('Event Emitter', function() {
2321
let TestObj;
2422

tests/keyhandler/test.keyhandleLong.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
describe('Longpress handling', function() {
2321
this.timeout(0);
2422
let app;

tests/keyhandler/test.keyhandler.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
describe('Key handling', function() {
2321
this.timeout(0);
2422
let app;

tests/layout/test.misc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
2120
import FlexTestUtils from "./src/FlexTestUtils.mjs";
2221

2322
const flexTestUtils = new FlexTestUtils();

tests/shaders/test.grayscale.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
describe('Shaders', function() {
2321
this.timeout(0);
2422

tests/test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
<script>mocha.setup('bdd')</script>
3434

35+
<script src="../dist/lightning.es5.js"></script>
3536
<script src="textures/test.textures.js" type="module"></script>
3637
<script src="textures/test.text.js" type="module"></script>
3738
<script src="keyhandler/test.keyhandler.js" type="module"></script>

tests/textures/test.text.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
const EXAMPLE_TEXT =
2321
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin nibh augue, \
2422
suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque \

tests/textures/test.textures.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
import lng from '../../src'
21-
2220
describe('textures', function() {
2321
this.timeout(0);
2422

0 commit comments

Comments
 (0)