Skip to content

Commit aa9b768

Browse files
committed
fix tests
1 parent f1ae4d0 commit aa9b768

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports.analyze = (source) => {
3636

3737
if (Array.isArray(source)) {
3838
source.forEach((filePath) => {
39-
let fullPath = path.resolve(filePath)
39+
let fullPath = path.resolve(__dirname, filePath)
4040
let content = read.sync(fullPath, 'utf8')
4141
result = escomplex.analyse(content)
4242
report = sanitize(path.basename(filePath), filePath, result)

test/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ const properties = [
6767
describe('inspekter-plugin-javascript', () => {
6868
describe('analyze', () => {
6969
it('should always return an array', () => {
70-
const source = ['fixtures/file1.js']
70+
const source = ['test/fixtures/file1.js']
7171
const actual = ipj.analyze(source)
7272

7373
expect(actual).to.be.an('array')
7474
expect(actual).to.have.lengthOf(1)
7575
})
7676

7777
it('should return one report object for each file', () => {
78-
const source = ['fixtures/file1.js', 'fixtures/file2.js']
78+
const source = ['test/fixtures/file1.js', 'test/fixtures/file2.js']
7979
const actual = ipj.analyze(source)
8080

8181
expect(actual).to.be.an('array')
8282
expect(actual).to.have.lengthOf(2)
8383
})
8484

8585
it('should return an object with all standard properties', () => {
86-
const source = ['fixtures/file1.js']
86+
const source = ['test/fixtures/file1.js']
8787
const actual = ipj.analyze(source)[0]
8888

8989
properties.forEach((property) => {

0 commit comments

Comments
 (0)