diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..15d91a4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Release + +on: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: yarn + + - run: yarn install --pure-lockfile + - run: yarn typecheck + - run: yarn test + - run: yarn build + + - name: Publish + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/test/__snapshots__/cache.test.ts.snap b/test/__snapshots__/cache.test.ts.snap index f03b7ee..03af527 100644 --- a/test/__snapshots__/cache.test.ts.snap +++ b/test/__snapshots__/cache.test.ts.snap @@ -223,7 +223,7 @@ Map { Symbol(lastName): "Acthernoene", Symbol(firstName): "Mathieu", Symbol(identificationLevels): { - Symbol(__typename): undefined, + Symbol(__typename): "IdentificationLevels", Symbol(expert): true, Symbol(PVID): true, Symbol(QES): false, @@ -265,8 +265,8 @@ Map { Symbol(__typename): "Mutation", Symbol(bindAccountMembership({"input":{"accountMembershipId":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}})): { Symbol(__typename): "BindAccountMembershipSuccessPayload", + Symbol(message): "Account is in invalid status", Symbol(accountMembership): Symbol(AccountMembership), - Symbol(message): undefined, }, }, }, @@ -337,7 +337,7 @@ Map { Symbol(firstName): "Matthias", Symbol(lastName): "Le Brun", Symbol(identificationLevels): { - Symbol(__typename): undefined, + Symbol(__typename): "IdentificationLevels", Symbol(expert): true, Symbol(PVID): true, Symbol(QES): true, @@ -377,7 +377,7 @@ Map { Symbol(lastName): "Acthernoene", Symbol(firstName): "Mathieu", Symbol(identificationLevels): { - Symbol(__typename): undefined, + Symbol(__typename): "IdentificationLevels", Symbol(expert): true, Symbol(PVID): true, Symbol(QES): false, @@ -419,8 +419,8 @@ Map { Symbol(__typename): "Mutation", Symbol(bindAccountMembership({"input":{"accountMembershipId":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}})): { Symbol(__typename): "BindAccountMembershipSuccessPayload", + Symbol(message): "Account is in invalid status", Symbol(accountMembership): Symbol(AccountMembership), - Symbol(message): undefined, }, }, }, diff --git a/test/cache.test.ts b/test/cache.test.ts index 56d198c..8bb4d8a 100644 --- a/test/cache.test.ts +++ b/test/cache.test.ts @@ -114,6 +114,7 @@ test("Write & read in cache", () => { getAppQueryResponse({ user2LastName: "Acthernoene", user1IdentificationLevels: { + __typename: "IdentificationLevels", expert: true, PVID: true, QES: true, @@ -136,6 +137,7 @@ test("Write & read in cache", () => { getAppQueryResponse({ user2LastName: "Acthernoene", user1IdentificationLevels: { + __typename: "IdentificationLevels", expert: true, PVID: true, QES: true, diff --git a/test/data.ts b/test/data.ts index 7703cb1..6083f8d 100644 --- a/test/data.ts +++ b/test/data.ts @@ -158,6 +158,7 @@ export const getAppQueryResponse = ({ }: { user2LastName: string; user1IdentificationLevels: { + __typename: "IdentificationLevels"; expert: boolean; PVID: boolean; QES: boolean; @@ -267,6 +268,7 @@ export const bindMembershipMutationSuccessResponse = { firstName: "Mathieu", lastName: "Acthernoene", identificationLevels: { + __typename: "IdentificationLevels", expert: true, PVID: true, QES: false,