-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78ecfd6
commit c465226
Showing
8 changed files
with
114 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/theme-check-node': patch | ||
--- | ||
|
||
Fix theme file glob on Windows (CLI issue) |
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
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
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,41 @@ | ||
import { describe, it, expect, assert, beforeEach, afterEach } from 'vitest'; | ||
import * as path from 'node:path'; | ||
import { Config, SourceCodeType, getTheme } from './index'; | ||
import { Workspace, makeTempWorkspace } from './test/test-helpers'; | ||
|
||
describe('Unit: getTheme', () => { | ||
let workspace: Workspace; | ||
|
||
beforeEach(async () => { | ||
workspace = await makeTempWorkspace({ | ||
locales: { | ||
'en.default.json': '{}', | ||
}, | ||
snippets: { | ||
'header.liquid': '', | ||
}, | ||
}); | ||
}); | ||
|
||
afterEach(async () => { | ||
await workspace.clean(); | ||
}); | ||
|
||
it('should correctly get theme on all platforms', async () => { | ||
const config: Config = { | ||
checks: [], | ||
root: workspace.root, | ||
settings: {}, | ||
}; | ||
|
||
const theme = await getTheme(config); | ||
expect(theme).to.have.lengthOf(2); | ||
const jsonFile = theme.find((sc) => sc.type === SourceCodeType.JSON); | ||
assert(jsonFile); | ||
|
||
// internally we expect the path to be normalized | ||
expect(jsonFile.absolutePath).to.equal( | ||
workspace.path('locales/en.default.json').replace(/\\/g, '/'), | ||
); | ||
}); | ||
}); |
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