Skip to content

Commit

Permalink
fix(gatsby): test plugin name to handle symlinks, rather than path (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DSchau authored and pieh committed Jan 8, 2019
1 parent 9b6f365 commit f914607
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -68,7 +68,12 @@ describe(`resolveThemes`, () => {
it(`returns empty array if zero themes detected`, () => {
;[
[],
[{ resolve: path.join(base, `gatsby-plugin-whatever`) }],
[
{
name: `gatsby-plugin-whatever`,
resolve: path.join(base, `gatsby-plugin-whatever`),
},
],
undefined,
].forEach(testRun => {
expect(resolveThemes(testRun)).toEqual([])
Expand All @@ -80,6 +85,7 @@ describe(`resolveThemes`, () => {
expect(
resolveThemes([
{
name: theme,
resolve: path.join(base, `gatsby-theme-example`),
},
])
Expand All @@ -92,6 +98,7 @@ describe(`resolveThemes`, () => {
expect(
resolveThemes([
{
name: theme,
resolve: path.join(base, theme),
},
])
Expand Down
Expand Up @@ -66,7 +66,7 @@ const overlayErrorID = `graphql-compiler`

const resolveThemes = (plugins = []) =>
plugins.reduce((merged, plugin) => {
if (plugin.resolve.includes(`gatsby-theme-`)) {
if (plugin.name.includes(`gatsby-theme-`)) {
merged.push(plugin.resolve)
}
return merged
Expand Down

0 comments on commit f914607

Please sign in to comment.