rajasegar / alacritty-themes

:rainbow: :lollipop: Themes :candy: :heart_eyes: for Alacritty: A cross-platform GPU-accelerated Terminal emulator
MIT License
699 stars 71 forks source link

refactor: extract possible location #28

Closed JuanVqz closed 3 years ago

JuanVqz commented 3 years ago

I wanted to create a test but I don't know how to stub process.env.HOME, process.env.APPDATA in mocha, in fact, I haven't experienced doing testing in javascript,

I read a lot and I think jest it's a good option to go, what do you think?

This test will fail when the /home/itox/ changes in another machine. ex. into the CI. do you know how to solve it?

const assert = require('assert');

const { possibleLocations } = require('../../bin/helpers/possibleLocations');

describe('possibleLocations', () => {
  it('returns two locations by default', () => {
    assert.deepStrictEqual(possibleLocations(), [
      '/home/itox/.config/alacritty/alacritty.yml',
      '/home/itox/.alacritty.yml',
    ]);
  });
});
rajasegar commented 2 years ago

:tada: This PR is included in version 4.1.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: