Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
View changelog
  • Loading branch information
dansysanalyst committed Jun 18, 2021
1 parent fcf07a0 commit 47a76a6
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 140 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

All notable changes to the "pest-snippets" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [1.0]

- Removed `->` from `pex:`
- Removed indentation from every `pex:...`
- Removed expect() from every `pex:...`
- Removed uncessary key focousing from `pex:...` which do not accept arguments
- Added `:pexjson` for `json()` method from Pest 1.6.0
- Added `:pextobedirectory` for `->toBeDirectory()`
- Added `:ptewip` and `pitwip` for creating test functions with Skip->('wip')

## [0.1.0]

Expand Down
125 changes: 77 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Type `:pte` + [TAB] for:

```php
test('', function () {
//..
//expect()->
});
```

Type `:pit` + [TAB] for:

```php
it('', function () {
//..
//expect()->
});
```

Expand All @@ -44,6 +44,26 @@ test('', function () {
})->only();
```

#### Skipping tests (wip)

`wip` stands for "Work In Progress".

Type `:ptewip` / `:pitwip` for the desired function with `skip('wip')`:

```php
test('', function () {
//..
})->skip('wip');
```

Type `:pteo` / `:pito` + [TAB] for the desired function with `only()`:

```php
test('', function () {
//..
})->only();
```

#### Groups of tests

Type `:pteg` / `:pitg` + [TAB] for the desired function with `group()`:
Expand Down Expand Up @@ -113,64 +133,73 @@ afterAll(function () {
Type `:pex` + [TAB] for:

```php
expect()->
expect()
```

Start typing `:pex` and complete with your desired `expect()` method.
Continue typing `:pex` and complete with your desired `expect()` method.

For example, `:pextobe` + [TAB] produces:

Example: Type `pex:tobe` + [TAB] produces:
```php
->toBe()
```

All together:

```php
expect()->toBe()
expect()->toBe()
```


Available `expect()` methods:

| Trigger | Snippet |
| -------- | ---------------- |
| :pextobe | expect()->toBe() |
| :pextobeempty | expect()->toBeEmpty() |
| :pextobetrue | expect()->toBeTrue() |
| :pextobefalse | expect()->toBeFalse() |
| :pextobegreaterthan | expect()->toBeGreaterThan() |
| :pextobegreaterthanorequal | expect()->toBeGreaterThanOrEqual() |
| :pextobelessthan | expect()->toBeLessThan() |
| :pextobelessthanorequal | expect()->toBeLessThanOrEqual() |
| :pextocontain | expect()->toContain() |
| :pextohavecount | expect()->toHaveCount() |
| :pextohaveproperty | expect()->toHaveProperty() |
| :pextomatcharray | expect()->toMatchArray() |
| :pextomatchobject | expect()->toMatchObject() |
| :pextoequal | expect()->toEqual() |
| :pextoequalcanonicalizing | expect()->toEqualCanonicalizing() |
| :pextoequalwithdelta | expect()->toEqualWithDelta() |
| :pextobeinfinite | expect()->toBeInfinite() |
| :pextobeinstanceof | expect()->toBeInstanceOf() |
| :pextobebool | expect()->toBeBool() |
| :pextobecallable | expect()->toBeCallable() |
| :pextobefloat | expect()->toBeFloat() |
| :pextobeint | expect()->toBeInt() |
| :pextobeiterable | expect()->toBeIterable() |
| :pextobenumeric | expect()->toBeNumeric() |
| :pextobeobject | expect()->toBeObject() |
| :pextoberesource | expect()->toBeResource() |
| :pextobescalar | expect()->toBeScalar() |
| :pextobestring | expect()->toBeString() |
| :pextobejson | expect()->toBeJson() |
| :pextobenan | expect()->toBeNan() |
| :pextobenull | expect()->toBeNull() |
| :pextohavekey | expect()->toHaveKey() |
| :pextohavekeys | expect()->toHaveKeys() |
| :pextobereadabledirectory | expect()->toBeReadableDirectory() |
| :pextobewritabledirectory | expect()->toBeWritableDirectory() |
| :pextostartwith | expect()->toStartWith() |
| :pextoendwith | expect()->toEndWith() |
| :pextomatch | expect()->PestExpectToMatch() |
| :pextomatchconstraint | expect()->toMatchConstraint() |
| :pexdd | expect()->dd() |
| :pexray | expect()->ray()|
| :pex | expect()-> |
| :pextobe | ->toBe() |
| :pextobeempty | ->toBeEmpty() |
| :pextobetrue | ->toBeTrue() |
| :pextobefalse | ->toBeFalse() |
| :pextobegreaterthan | ->toBeGreaterThan() |
| :pextobegreaterthanorequal | ->toBeGreaterThanOrEqual() |
| :pextobelessthan | ->toBeLessThan() |
| :pextobelessthanorequal | ->toBeLessThanOrEqual() |
| :pextocontain | ->toContain() |
| :pextohavecount | ->toHaveCount() |
| :pextohaveproperty | ->toHaveProperty() |
| :pextomatcharray | ->toMatchArray() |
| :pextomatchobject | ->toMatchObject() |
| :pextoequal | ->toEqual() |
| :pextoequalcanonicalizing | ->toEqualCanonicalizing() |
| :pextoequalwithdelta | ->toEqualWithDelta() |
| :pextobeinfinite | ->toBeInfinite() |
| :pextobeinstanceof | ->toBeInstanceOf() |
| :pextobebool | ->toBeBool() |
| :pextobecallable | ->toBeCallable() |
| :pextobefloat | ->toBeFloat() |
| :pextobeint | ->toBeInt() |
| :pextobeiterable | ->toBeIterable() |
| :pextobenumeric | ->toBeNumeric() |
| :pextobeobject | ->toBeObject() |
| :pextoberesource | ->toBeResource() |
| :pextobescalar | ->toBeScalar() |
| :pextobestring | ->toBeString() |
| :pextobejson | ->toBeJson() |
| :pextobenan | ->toBeNan() |
| :pextobenull | ->toBeNull() |
| :pextohavekey | ->toHaveKey() |
| :pextohavekeys | ->toHaveKeys() |
| :pextobedirectory | ->toBeReadableDirectory() |
| :pextobereadabledirectory | ->toBeReadableDirectory() |
| :pextobewritabledirectory | ->toBeWritableDirectory() |
| :pextostartwith | ->toStartWith() |
| :pextoendwith | ->toEndWith() |
| :pextomatch | ->PestExpectToMatch() |
| :pextomatchconstraint | ->toMatchConstraint() |
| :pexdd | ->dd() |
| :pexray | ->ray()|
| :pexjson | ->json()-> |
| :pexand | ->and()-> |
| :pexnot | ->not()-> |
| :pexeach | ->each()-> |
| :pexsequence | ->sequence() |
| :pexsequence | ->sequence() |
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Pest Snippets",
"publisher": "dansysanalyst",
"description": "Snippets for Pest PHP testing framework",
"version": "0.1.0",
"version": "1.0",
"engines": {
"vscode": "^1.57.0"
},
Expand Down
Loading

0 comments on commit 47a76a6

Please sign in to comment.