Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #300 from atom/failing-test-electron-5
Browse files Browse the repository at this point in the history
Fix failing test that overrides core packages
  • Loading branch information
darangi authored Feb 13, 2020
2 parents a54d618 + 8e9bc64 commit 36054ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ module.exports = {
loadPackageSnippets (callback) {
const disabledPackageNames = atom.config.get('core.packagesWithSnippetsDisabled') || []
const packages = atom.packages.getLoadedPackages().sort((pack, _) => {
return /\/app\.asar\/node_modules\//.test(pack.path) ? -1 : 1
return /\/node_modules\//.test(pack.path) ? -1 : 1
})

const snippetsDirPaths = []
Expand Down
4 changes: 2 additions & 2 deletions spec/snippet-loading-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ describe("Snippet Loading", () => {

describe("::loadPackageSnippets(callback)", () => {
beforeEach(() => { // simulate a list of packages where the javascript core package is returned at the end
atom.packages.getLoadedPackages.andReturn([
atom.packages.getLoadedPackages.andReturn([
atom.packages.loadPackage(path.join(__dirname, 'fixtures', 'package-with-snippets')),
atom.packages.loadPackage('language-javascript')
]);
])
});

it("allows other packages to override core packages' snippets", () => {
Expand Down

0 comments on commit 36054ba

Please sign in to comment.