Skip to content

Commit

Permalink
fix: change script name because yarn create tries to run create-cli…
Browse files Browse the repository at this point in the history
…ent and fail (#342)
  • Loading branch information
ValentinCrochemore authored Oct 6, 2022
1 parent 19ef9d9 commit f856fbf
Show file tree
Hide file tree
Showing 5 changed files with 604 additions and 571 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.6.0",
"@playwright-testing-library/test": "4.4.0-beta.1",
"@playwright-testing-library/test": "4.5.0",
"@playwright/test": "^1.25.0",
"babel-jest": "^29.0.0",
"eslint": "^8.22.0",
Expand All @@ -40,7 +40,7 @@
"tmp": "^0.2.0"
},
"dependencies": {
"@api-platform/api-doc-parser": "^0.15.0",
"@api-platform/api-doc-parser": "^0.16.0",
"@babel/runtime": "^7.0.0",
"chalk": "^5.0.0",
"commander": "^9.4.0",
Expand All @@ -67,13 +67,13 @@
"test-react-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create react-app --template typescript ./tmp/app/reactapp && yarn --cwd ./tmp/app/reactapp add react-router-dom react-hook-form && cp -R ./tmp/react/* ./tmp/app/reactapp/src && cp ./templates/react/index.tsx ./tmp/app/reactapp/src && start-server-and-test 'BROWSER=none yarn --cwd ./tmp/app/reactapp start' http://127.0.0.1:3000/books/ 'yarn playwright test'",
"test-next-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create next-app --typescript ./tmp/app/next && yarn --cwd ./tmp/app/next add isomorphic-unfetch formik react-query && cp -R ./tmp/next/* ./tmp/app/next && rm ./tmp/app/next/pages/index.tsx && rm -rf ./tmp/app/next/pages/api && yarn --cwd ./tmp/app/next build && start-server-and-test 'yarn --cwd ./tmp/app/next start' http://127.0.0.1:3000/books/ 'yarn playwright test'",
"test-vue-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && cd ./tmp/app && npm init -y vue@2 -- --router vue && cd ../.. && yarn --cwd ./tmp/app/vue add vuex@3 vuex-map-fields lodash && cp -R ./tmp/vue/* ./tmp/app/vue/src && cp ./templates/vue/main.js ./tmp/app/vue/src && yarn --cwd ./tmp/app/vue build && start-server-and-test 'yarn --cwd ./tmp/app/vue vite preview --host 127.0.0.1 --port 3000' http://127.0.0.1:3000/books/ 'yarn playwright test'",
"test-nuxt-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create nuxt-app --answers \"'{\\\"name\\\":\\\"nuxt\\\",\\\"language\\\":\\\"js\\\",\\\"pm\\\":\\\"yarn\\\",\\\"ui\\\":\\\"vuetify\\\",\\\"features\\\":[],\\\"linter\\\":[],\\\"test\\\":\\\"none\\\",\\\"mode\\\":\\\"spa\\\",\\\"target\\\":\\\"static\\\",\\\"devTools\\\":[],\\\"vcs\\\":\\\"none\\\"}'\" ./tmp/app/nuxt && yarn --cwd ./tmp/app/nuxt add moment lodash vuelidate vuex-map-fields && cp -R ./tmp/nuxt/* ./tmp/app/nuxt && NUXT_TELEMETRY_DISABLED=1 yarn --cwd ./tmp/app/nuxt generate && start-server-and-test 'yarn --cwd ./tmp/app/nuxt start --hostname 127.0.0.1' http://127.0.0.1:3000/books/ 'yarn playwright test'"
"test-nuxt-app": "rm -rf ./tmp/app && mkdir -p ./tmp/app && yarn create nuxt-app --answers \"'{\\\"name\\\":\\\"nuxt\\\",\\\"language\\\":\\\"js\\\",\\\"pm\\\":\\\"yarn\\\",\\\"ui\\\":\\\"vuetify\\\",\\\"template\\\":\\\"html\\\",\\\"features\\\":[],\\\"linter\\\":[],\\\"test\\\":\\\"none\\\",\\\"mode\\\":\\\"spa\\\",\\\"target\\\":\\\"static\\\",\\\"devTools\\\":[],\\\"vcs\\\":\\\"none\\\"}'\" ./tmp/app/nuxt && yarn --cwd ./tmp/app/nuxt add moment lodash vuelidate vuex-map-fields && cp -R ./tmp/nuxt/* ./tmp/app/nuxt && NUXT_TELEMETRY_DISABLED=1 yarn --cwd ./tmp/app/nuxt generate && start-server-and-test 'yarn --cwd ./tmp/app/nuxt start --hostname 127.0.0.1' http://127.0.0.1:3000/books/ 'yarn playwright test'"
},
"lint-staged": {
"src/**/*.js": "yarn lint --fix"
},
"bin": {
"generate-api-platform-client": "./lib/index.js"
"create-client": "./lib/index.js"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions tests/edit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test as baseTest, expect } from '@playwright/test';
import { locatorFixtures as fixtures, within } from '@playwright-testing-library/test/fixture.js';
import { locatorFixtures as fixtures } from '@playwright-testing-library/test/fixture.js';
import type { LocatorFixtures as TestingLibraryFixtures } from '@playwright-testing-library/test/fixture.js';

const test = baseTest.extend<TestingLibraryFixtures>(fixtures)

test('resource edit', async ({ page, queries: { getAllByRole, getByLabelText, getByRole, getByText, queryByRole, queryByText } }) => {
test('resource edit', async ({ page, within, queries: { getAllByRole, getByLabelText, getByRole, getByText, queryByRole, queryByText } }) => {
await page.goto('http://localhost:3000/books/');

await expect(queryByText('Loading...')).not.toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions tests/list.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test as baseTest, expect } from '@playwright/test';
import { locatorFixtures as fixtures, within } from '@playwright-testing-library/test/fixture.js';
import { locatorFixtures as fixtures } from '@playwright-testing-library/test/fixture.js';
import type { LocatorFixtures as TestingLibraryFixtures } from '@playwright-testing-library/test/fixture.js';

const test = baseTest.extend<TestingLibraryFixtures>(fixtures)

test('resource list', async ({ page, queries: { getAllByRole, getByLabelText, getByRole, queryByRole, queryByText } }) => {
test('resource list', async ({ page, within, queries: { getAllByRole, getByLabelText, getByRole, queryByRole, queryByText } }) => {
await page.goto('http://localhost:3000/books/');

await expect(queryByText('Loading...')).not.toBeVisible();
Expand Down
4 changes: 2 additions & 2 deletions tests/show.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { test as baseTest, expect } from '@playwright/test';
import { locatorFixtures as fixtures, within } from '@playwright-testing-library/test/fixture.js';
import { locatorFixtures as fixtures } from '@playwright-testing-library/test/fixture.js';
import type { LocatorFixtures as TestingLibraryFixtures } from '@playwright-testing-library/test/fixture.js';

const test = baseTest.extend<TestingLibraryFixtures>(fixtures)

test('resource show', async ({ page, queries: { getAllByRole, getByRole, queryByRole, queryByText } }) => {
test('resource show', async ({ page, within, queries: { getAllByRole, getByRole, queryByRole, queryByText } }) => {
await page.goto('http://localhost:3000/books/');

await expect(queryByText('Loading...')).not.toBeVisible();
Expand Down
Loading

0 comments on commit f856fbf

Please sign in to comment.