File: test.js

package info (click to toggle)
node-global-prefix 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 128 kB
  • sloc: makefile: 4; sh: 2
file content (27 lines) | stat: -rw-r--r-- 713 bytes parent folder | download
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
27
/*!
 * global-prefix <https://github.com/jonschlinkert/global-prefix>
 *
 * Copyright (c) 2015 Jon Schlinkert.
 * Licensed under the MIT license.
 */

'use strict';

require('mocha');
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var isWindows = require('is-windows');
var prefix = require('./');

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

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