Skip to content

Commit

Permalink
Consistency in unit-test imports, use ../src and not ../lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Aug 19, 2017
1 parent 78dea30 commit 54e7c8c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
5 changes: 2 additions & 3 deletions test/test-asf.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {} from "mocha";
import {assert} from 'chai';
import * as mm from '../src';
import {INativeTagDict} from "../lib/index";
import * as path from 'path';
import GUID from "../lib/asf/GUID";
import GUID from "../src/asf/GUID";
import * as fs from 'fs-extra';

const t = assert;
Expand Down Expand Up @@ -42,7 +41,7 @@ describe("ASF", () => {
t.deepEqual(common.genre, ['Rock'], 'common.genre');
}

function checkNative(native: INativeTagDict) {
function checkNative(native: mm.INativeTagDict) {

t.deepEqual(native['WM/AlbumTitle'], ['Discovery'], 'native: WM/AlbumTitle');
t.deepEqual(native['WM/BeatsPerMinute'], [117], 'native: WM/BeatsPerMinute');
Expand Down
4 changes: 2 additions & 2 deletions test/test-common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {} from "mocha";
import {assert} from 'chai';
import Common from "../lib/common";
import Common from "../src/common";

const t = assert;

Expand Down Expand Up @@ -40,7 +40,7 @@ describe("Common", () => {
const types = [
{
buf: new Buffer([0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32]),
tag: require('../lib/id4'),
tag: require('../src/id4'),
offset: 4
}
];
Expand Down
2 changes: 1 addition & 1 deletion test/test-findzero.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {} from "mocha";
import {assert} from 'chai';
import * as common from '../lib/common';
import * as common from '../src/common';

const findZero = common.default.findZero;

Expand Down
3 changes: 1 addition & 2 deletions test/test-id3v1.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {assert} from 'chai';
import * as mm from '../src';

import * as path from 'path';
import {ICommonTagsResult} from "../lib/index";

const t = assert;

Expand All @@ -23,7 +22,7 @@ describe("ID3v1.1", () => {
t.strictEqual(format.numberOfChannels, 2, 'format.numberOfChannels 2 (stereo)');
}

function checkCommon(common: ICommonTagsResult) {
function checkCommon(common: mm.ICommonTagsResult) {
t.strictEqual(common.title, 'Blood Sugar', 'common.title');
t.strictEqual(common.artist, 'Pendulum', 'common.artist');
t.strictEqual(common.album, 'Blood Sugar (Single)', 'common.album');
Expand Down
3 changes: 1 addition & 2 deletions test/test-id3v2.3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {} from "mocha";
import {assert} from 'chai';
import * as mm from '../src';
import {INativeTagDict} from "../lib/index";
import * as path from 'path';

const t = assert;
Expand Down Expand Up @@ -35,7 +34,7 @@ it("should decode id3v2.3", () => {
t.strictEqual(common.picture[0].data.length, 80938, 'common.picture length');
}

function checkNative(native: INativeTagDict) {
function checkNative(native: mm.INativeTagDict) {

t.deepEqual(native.TALB, ['Friday Night Lights [Original Movie Soundtrack]'], 'native: TALB');
t.deepEqual(native.TPE1, ['Explosions In The Sky', 'Another', 'And Another'], 'native: TPE1');
Expand Down
6 changes: 3 additions & 3 deletions test/test-picard-mappings.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {} from "mocha";
import {assert} from 'chai';
import {APEv2TagMap} from "../lib/apev2/APEv2TagMap";
import {AsfTagMap} from "../lib/asf/AsfTagMap";
import {ID3v24TagMap} from "../lib/id3v2/ID3v24TagMap";
import {APEv2TagMap} from "../src/apev2/APEv2TagMap";
import {AsfTagMap} from "../src/asf/AsfTagMap";
import {ID3v24TagMap} from "../src/id3v2/ID3v24TagMap";

describe("Parsing of metadata saved by 'Picard' in audio files", () => {

Expand Down
11 changes: 5 additions & 6 deletions test/test-picard-parsing.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {} from "mocha";
import {assert} from 'chai';
import * as mm from '../src';
import {ICommonTagsResult, INativeTagDict} from "../lib/index";
import * as path from 'path';
import {HeaderType} from "../lib/tagmap";
import {HeaderType} from "../src/tagmap";
import * as crypto from "crypto";

const t = assert;
Expand Down Expand Up @@ -45,7 +44,7 @@ describe("Parsing of metadata saved by 'Picard' in audio files", () => {
* @param inputTagType Meta-data header format
* @param common Common tag mapping
*/
function checkCommonMapping(inputTagType: HeaderType, common: ICommonTagsResult) {
function checkCommonMapping(inputTagType: HeaderType, common: mm.ICommonTagsResult) {
// Compare expectedCommonTags with result.common
t.strictEqual(common.title, "Sinner's Prayer", inputTagType + " => common.title");
t.strictEqual(common.artist, 'Beth Hart & Joe Bonamassa', inputTagType + " => common.artist");
Expand Down Expand Up @@ -107,7 +106,7 @@ describe("Parsing of metadata saved by 'Picard' in audio files", () => {
* Check native Vorbis header
* @param vorbis Vorbis native tags
*/
function checkVorbisTags(vorbis: INativeTagDict, dataformat: string) {
function checkVorbisTags(vorbis: mm.INativeTagDict, dataformat: string) {
// Compare expectedCommonTags with result.common
t.deepEqual(vorbis.TITLE, ['Sinner\'s Prayer'], 'vorbis.TITLE');
t.deepEqual(vorbis.ALBUM, ['Don\'t Explain'], 'vorbis.TITLE');
Expand Down Expand Up @@ -214,7 +213,7 @@ describe("Parsing of metadata saved by 'Picard' in audio files", () => {

describe("APEv2 header", () => {

function checkApeTags(APEv2: INativeTagDict) {
function checkApeTags(APEv2: mm.INativeTagDict) {
// Compare expectedCommonTags with result.common
t.deepEqual(APEv2.Title, ['Sinner\'s Prayer'], 'APEv2.Title');
t.deepEqual(APEv2.Album, ['Don\'t Explain'], 'APEv2.Album');
Expand Down Expand Up @@ -329,7 +328,7 @@ describe("Parsing of metadata saved by 'Picard' in audio files", () => {

describe("ID3v2.3 header", () => {

function checkID3Tags(native: INativeTagDict) {
function checkID3Tags(native: mm.INativeTagDict) {

t.deepEqual(native.TIT2, ['Sinner\'s Prayer'], 'id3v23.TIT2: Title/songname/content description');
t.deepEqual(native.TPE1, ['Beth Hart & Joe Bonamassa'], 'id3v23.TPE1: Lead performer(s)/Soloist(s)');
Expand Down
2 changes: 1 addition & 1 deletion test/test-tagmap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {} from "mocha";
import {assert} from 'chai';
import TagMap, {ITagInfoMap} from "../lib/tagmap";
import TagMap, {ITagInfoMap} from "../src/tagmap";

const t = assert;

Expand Down
2 changes: 1 addition & 1 deletion test/test-unexpected-eos.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {} from "mocha";
import {assert} from 'chai';
import * as mm from '../src';
import Common from "../lib/common";
import Common from "../src/common";

/* ToDo?
import * as path from 'path';
Expand Down

0 comments on commit 54e7c8c

Please sign in to comment.