Skip to content

Commit

Permalink
patch: progress
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidg3 committed Sep 21, 2024
1 parent 1099010 commit 08b2330
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/concepts/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ responsePayload.builder.ts
3. **event.options.ts**: Additional options for an event (including permissions).
4. **responsePayload.builder.ts**: The schema of the payload that is returned when the event is handled.

## Events & Listeners
## Events & Faked Listeners

### Registering an Event

Expand Down Expand Up @@ -129,7 +129,7 @@ spruce create.event
<details>
<summary><strong>Production 1b</strong>: Define your event</summary>

Now is a great time to do some event design work. Once your event is defined, make sure you run the following:
Now is a great time to do some event design work. Finde Once your event is defined, make sure you run the following:

```bash
spruce sync.events
Expand Down
43 changes: 43 additions & 0 deletions src/pages/concepts/stores.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,49 @@ Stores are a database agnostic way to persist data in your skill. Thare have a s
* `find(...)`: Find many records in the store.
* `scramble(...)`: Scramble a record in the store.

## Current Adapters

Currently, the Spruce Platform has 3 adapters for `Stores`:

1. NeDb: For testing and development purposes.
2. MongoDb: The default adapter for production.
3. Postgres: Can be enabled for production and/or tests.


## Stores in Development

During development, by default, the `Stores` layer will utilize a `MongoDb` in memory store called `NeDb`. While this database is no longer supported, it provides enough functionality to work for testing and development purposes.

### Seeding Data

When you are in development, you may want to seed your store with data so you can test against it. Luckily, that's a pretty easy thing to do! Let's walk through it!

For this scenario, we're going to ensure that our `listener` returns the expected results from the Database. We'll start with some listener tests that have already been created.

<details>
<summary><strong>Test 1</strong>: Add the <em>@seed(...)</em> decorator</summary>

```typescript
import { AbstractSpruceFixtureTest } from '@sprucelabs/spruce-test-fixtures'
import { test } from '@sprucelabs/test-utils'
import { crudAssert } from '@sprucelabs/spruce-crud-utils'

export default class RootSkillViewTest extends AbstractSpruceFixtureTest {
@test()
protected static async rendersMaster() {
const vc = this.views.Controller('eightbitstories.root', {})
crudAssert.skillViewRendersMasterView(]vc)
}
}
```

</details>


### Custom Data

## Stores in Production

### Something Missing?

<div class="grid-buttons">
Expand Down

0 comments on commit 08b2330

Please sign in to comment.