-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint: format & fix style issues in project
- Loading branch information
1 parent
247accb
commit 79850dc
Showing
11 changed files
with
244 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{ | ||
"recommendations": [ | ||
"graphql.vscode-graphql" | ||
] | ||
"recommendations": ["graphql.vscode-graphql"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"formatter": { | ||
"enabled": true, | ||
"indentWidth": 2, | ||
"indentStyle": "space" | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
['@babel/preset-react', { runtime: 'automatic' }], | ||
'@babel/preset-typescript', | ||
["@babel/preset-env", { targets: { node: "current" } }], | ||
["@babel/preset-react", { runtime: "automatic" }], | ||
"@babel/preset-typescript", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
import { mount } from '@remote-ui/testing' | ||
import { createRoot } from '@remote-ui/react' | ||
import { Extension } from './Checkout' | ||
import * as Shopify from '@shopify/ui-extensions-react/checkout'; | ||
import '@remote-ui/testing/matchers'; | ||
import { createRoot } from "@remote-ui/react"; | ||
import { mount } from "@remote-ui/testing"; | ||
import * as Shopify from "@shopify/ui-extensions-react/checkout"; | ||
import { Extension } from "./Checkout"; | ||
import "@remote-ui/testing/matchers"; | ||
|
||
jest.mock('@shopify/ui-extensions-react/checkout', () => { | ||
return { | ||
__esModule: true, | ||
...jest.requireActual('@shopify/ui-extensions-react/checkout'), | ||
}; | ||
jest.mock("@shopify/ui-extensions-react/checkout", () => { | ||
return { | ||
__esModule: true, | ||
...jest.requireActual("@shopify/ui-extensions-react/checkout"), | ||
}; | ||
}); | ||
|
||
jest | ||
.spyOn(Shopify, 'useTranslate') | ||
.mockImplementation(() => (translationKey: string) => translationKey as any); | ||
.spyOn(Shopify, "useTranslate") | ||
// biome-ignore lint/suspicious/noExplicitAny: can't mock an i18n function | ||
.mockImplementation(() => (translationKey: string) => translationKey as any); | ||
|
||
jest.spyOn(Shopify, 'useApi').mockImplementation(() => ({ extension: { target: 'purchase.checkout.block.render' } })); | ||
jest.spyOn(Shopify, "useApi").mockImplementation(() => ({ | ||
extension: { target: "purchase.checkout.block.render" }, | ||
})); | ||
|
||
describe('Header', () => { | ||
it('renders the header', () => { | ||
const app = mount((root) => { | ||
createRoot(root).render(<Extension />) | ||
}) | ||
describe("Extension", () => { | ||
it("renders the welcome text", () => { | ||
const app = mount((root) => { | ||
createRoot(root).render(<Extension />); | ||
}); | ||
|
||
expect(app).toContainRemoteText('welcome'); | ||
}) | ||
}) | ||
expect(app).toContainRemoteText("welcome"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
presets: [ | ||
'@babel/preset-env', | ||
['@babel/preset-react', {runtime: 'automatic'}], | ||
"@babel/preset-typescript", | ||
], | ||
}; | ||
presets: [ | ||
"@babel/preset-env", | ||
["@babel/preset-react", { runtime: "automatic" }], | ||
"@babel/preset-typescript", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
import { mount } from '@remote-ui/testing' | ||
import { createRoot } from '@remote-ui/react' | ||
import { Extension } from './Checkout' | ||
import * as Shopify from '@shopify/ui-extensions-react/checkout'; | ||
import '@remote-ui/testing/matchers'; | ||
import { createRoot } from "@remote-ui/react"; | ||
import { mount } from "@remote-ui/testing"; | ||
import * as Shopify from "@shopify/ui-extensions-react/checkout"; | ||
import { Extension } from "./Checkout"; | ||
import "@remote-ui/testing/matchers"; | ||
|
||
jest.mock('@shopify/ui-extensions-react/checkout', () => { | ||
return { | ||
__esModule: true, | ||
...jest.requireActual('@shopify/ui-extensions-react/checkout'), | ||
}; | ||
jest.mock("@shopify/ui-extensions-react/checkout", () => { | ||
return { | ||
__esModule: true, | ||
...jest.requireActual("@shopify/ui-extensions-react/checkout"), | ||
}; | ||
}); | ||
|
||
jest | ||
.spyOn(Shopify, 'useTranslate') | ||
.mockImplementation(() => (translationKey) => translationKey); | ||
.spyOn(Shopify, "useTranslate") | ||
.mockImplementation(() => (translationKey) => translationKey); | ||
|
||
jest.spyOn(Shopify, 'useApi').mockImplementation(() => ({ extension: { target: 'purchase.checkout.block.render' } })); | ||
jest.spyOn(Shopify, "useApi").mockImplementation(() => ({ | ||
extension: { target: "purchase.checkout.block.render" }, | ||
})); | ||
|
||
describe('Header', () => { | ||
it('renders the header', () => { | ||
const app = mount((root) => { | ||
createRoot(root).render(<Extension />) | ||
}) | ||
describe("Extension", () => { | ||
it("renders the welcome text", () => { | ||
const app = mount((root) => { | ||
createRoot(root).render(<Extension />); | ||
}); | ||
|
||
expect(app).toContainRemoteText('welcome'); | ||
}) | ||
}) | ||
expect(app).toContainRemoteText("welcome"); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.