Skip to content

Commit

Permalink
Update dependencies (#5)
Browse files Browse the repository at this point in the history
* Update dependencies

* Bump version

* Update dependencies

* Update std
  • Loading branch information
KyleJune authored Jun 4, 2022
1 parent 9135bb8 commit 6aaa591
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 197 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
deno: [v1.x, canary]
deno: [v1.x]
fail-fast: true
services:
postgres:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migrate

[![version](https://img.shields.io/badge/release-0.2.2-success)](https://deno.land/x/[email protected].2)
[![version](https://img.shields.io/badge/release-0.2.3-success)](https://deno.land/x/[email protected].3)
[![CI](https://github.com/udibo/migrate/workflows/CI/badge.svg)](https://github.com/udibo/migrate/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/udibo/migrate/branch/main/graph/badge.svg?token=8Q7TSUFWUY)](https://codecov.io/gh/udibo/migrate)
[![license](https://img.shields.io/github/license/udibo/migrate)](https://github.com/udibo/migrate/blob/master/LICENSE)
Expand All @@ -21,9 +21,9 @@ Currently migrate is only implemented for Postgres. The main entrypoint is

```ts
// Import from Deno's third party module registry
import { PostgresMigrate } from "https://deno.land/x/[email protected].2/postgres.ts";
import { PostgresMigrate } from "https://deno.land/x/[email protected].3/postgres.ts";
// Import from GitHub
import { PostgresMigrate } "https://raw.githubusercontent.com/udibo/migrate/0.2.2/postgres.ts";
import { PostgresMigrate } "https://raw.githubusercontent.com/udibo/migrate/0.2.3/postgres.ts";
```
## Usage
Expand All @@ -34,7 +34,7 @@ To use the command line interface, you must create a script that will initialize
the Migrate instance and call the run command from [cli.ts](cli.ts). An example
can be found [here](#postgres-cli).
See [deno docs](https://doc.deno.land/https/deno.land/x/[email protected].2/cli.ts)
See [deno docs](https://doc.deno.land/https/deno.land/x/[email protected].3/cli.ts)
for more information.
#### Command: init
Expand Down Expand Up @@ -160,7 +160,7 @@ different ways to use the migrate module. Only one is required to use the
migrate tool.
See
[deno docs](https://doc.deno.land/https/deno.land/x/[email protected].2/postgres.ts)
[deno docs](https://doc.deno.land/https/deno.land/x/[email protected].3/postgres.ts)
for more information.
#### Postgres script
Expand Down
25 changes: 14 additions & 11 deletions basic_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { delay, resolve } from "./deps.ts";
import { PostgresMigrate } from "./postgres.ts";
import { assertEquals, test, TestSuite } from "./test_deps.ts";
import { assertEquals, describe, it } from "./test_deps.ts";
import {
cleanupInit,
exampleMigrationsDir,
Expand All @@ -9,14 +9,14 @@ import {
} from "./test_postgres.ts";
import "./basic.ts";

const applyTests = new TestSuite({
const applyTests = describe<InitializedMigrateTest>({
name: "apply",
async beforeEach(context: InitializedMigrateTest) {
context.migrate = new PostgresMigrate({
async beforeEach() {
this.migrate = new PostgresMigrate({
...options,
migrationsDir: exampleMigrationsDir,
});
const { migrate } = context;
const { migrate } = this;
await cleanupInit(migrate);
try {
await migrate.connect();
Expand All @@ -27,15 +27,16 @@ const applyTests = new TestSuite({
await migrate.end();
}
},
async afterEach({ migrate }: InitializedMigrateTest) {
await migrate.end();
async afterEach() {
await this.migrate.end();
},
});

test(
it(
applyTests,
"creates migration table and applies all migrations",
async ({ migrate }) => {
async function () {
const { migrate } = this;
const process = Deno.run({
cmd: [
resolve(migrate.migrationsDir, "../migrate_basic.ts"),
Expand Down Expand Up @@ -70,7 +71,8 @@ Done
},
);

test(applyTests, "applies unapplied migrations", async ({ migrate }) => {
it(applyTests, "applies unapplied migrations", async function () {
const { migrate } = this;
await migrate.connect();
await migrate.init();
await migrate.load();
Expand Down Expand Up @@ -113,7 +115,8 @@ Done
}
});

test(applyTests, "no unapplied migrations", async ({ migrate }) => {
it(applyTests, "no unapplied migrations", async function () {
const { migrate } = this;
await migrate.connect();
await migrate.init();
await migrate.load();
Expand Down
Loading

0 comments on commit 6aaa591

Please sign in to comment.