File: test.js

package info (click to toggle)
node-shebang-command 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 120 kB
  • sloc: javascript: 39; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const test = require('tape');
const shebangCommand = require('.');

test('main', t => {
	t.is(shebangCommand('#!/usr/bin/env node'), 'node');
	t.is(shebangCommand('#!/bin/bash'), 'bash');
	t.is(shebangCommand('#!/bin/bash -ex'), 'bash -ex');
	t.is(shebangCommand('#! /bin/bash'), 'bash');
	t.is(shebangCommand('#! /bin/bash -ex'), 'bash -ex');
	t.is(shebangCommand('#!/sh'), 'sh');
	t.is(shebangCommand('node'), null);
	t.is(shebangCommand(), null);
	t.end();
});