This commit is contained in:
Fergal Moran
2023-08-11 22:54:00 +01:00
parent e38ec92997
commit 197b4706d4
6 changed files with 2612 additions and 1 deletions

13
.editorconfig Normal file
View File

@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false

View File

@@ -2,4 +2,4 @@
A Next Auth adapter for using ASP.Net Core as your identity provider
An example API server can be found at [Damien Fowler](https://github.com/davidfowl)'s [IdentityEndpointsSample](https://github.com/davidfowl/IdentityEndpointsSample)
An example API server can be found at [David Fowler](https://github.com/davidfowl)'s [IdentityEndpointsSample](https://github.com/davidfowl/IdentityEndpointsSample)

2559
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
import {fixtures} from "../fixtures";
import {AspNetIdentityAdapter} from "../../src";
import {runBasicTests} from "../.";
runBasicTests({
adapter: AspNetIdentityAdapter(fixtures.baseUrl),
fixtures,
}).then(r => {
console.log('IdentityEndpointsSample', 'Tests complete', r)
});

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
CONTAINER_NAME=next-auth-aspnetcore-adapter-test
CONTAINER_PORT=8080
IMAGE_NAME="fergalmoran/aspnet-identity-sample"
echo "Cleaning up"
docker stop $CONTAINER_NAME
docker rm $CONTAINER_NAME
echo "Spinning up API endpoints"
docker run -d --rm \
--name $CONTAINER_NAME \
-p ${CONTAINER_PORT}:8080 \
$IMAGE_NAME
echo "Waiting for container start..." && sleep 1
jest ./index.test.ts --forceExit
docker stop $CONTAINER_NAME

8
tests/fixtures.ts Normal file
View File

@@ -0,0 +1,8 @@
export const fixtures = {
baseUrl: 'http://localhost:8080',
user: {
username: "fillmurray",
email: "fill@murray.com",
password: "FillMurray@12345!"
},
};