Skip to content

Commit b4f68bc

Browse files
authored
test: add initial tests for php and ts
1 parent 751d366 commit b4f68bc

11 files changed

Lines changed: 8484 additions & 2940 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ Thumbs.db
5050
dist/temp
5151
dist/.temp
5252

53+
# ignore jest coverage
54+
coverage
55+
5356
# -------------------------
5457
# BEGIN Whitelisted Files
5558
# -------------------------

bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
include_once __DIR__ . '/vendor/php-stubs/wordpress-stubs/wordpress-stubs.php';
4+
require_once __DIR__ . '/vendor/autoload.php';

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"require-dev": {
2828
"brain/monkey": "^2.6",
2929
"codedungeon/phpunit-result-printer": "^0.31.0",
30-
"phpunit/phpunit": "^9.5"
30+
"phpunit/phpunit": "^9.5",
31+
"php-stubs/wordpress-stubs": "^6.8"
3132
}
3233
}

composer.lock

Lines changed: 55 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} **/
2+
module.exports = {
3+
testEnvironment: "node",
4+
transform: {
5+
"^.+\.tsx?$": ["ts-jest",{}],
6+
},
7+
};

0 commit comments

Comments
 (0)