File: test.js

package info (click to toggle)
node-global-prefix 3.0.0%2B~3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 136 kB
  • sloc: javascript: 67; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*!
 * global-prefix <https://github.com/jonschlinkert/global-prefix>
 *
 * Copyright (c) 2015 Jon Schlinkert.
 * Licensed under the MIT license.
 */

'use strict';

require('mocha');
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const prefix = require('./');

describe('prefix', () => {
  it('should resolve the path to the windows global prefix', () => {
    if (process.platform === 'win32') {
      assert.equal(prefix, process.env.APPDATA ? path.join(process.env.APPDATA, 'npm') : path.dirname(process.execPath));
    }
  });

  it('should resolve the path to the global prefix', () => {
    assert(fs.existsSync(prefix));
  });
});