-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
87 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
.lock-wscript | ||
.DS_Store | ||
.project | ||
.DS_Store | ||
node_modules/ | ||
test-addon/build/ | ||
bin-*/ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const assert = require('node:assert').strict; | ||
const { describe, it } = require('node:test'); | ||
|
||
const { download } = require('..'); | ||
|
||
|
||
const url = 'https://raw.githubusercontent.com/node-3d/image-raub/refs/tags/4.3.0/test/freeimage.jpg'; | ||
|
||
|
||
describe('AT / Download', async () => { | ||
const data = await download(url); | ||
|
||
it('data is Buffer', () => { | ||
assert.strictEqual(data.constructor, Buffer); | ||
}); | ||
|
||
it('downloaded byte count is correct', async () => { | ||
assert.strictEqual(data.length, 7972); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const assert = require('node:assert').strict; | ||
const { describe, it } = require('node:test'); | ||
|
||
const { install, exists, getBin } = require('..'); | ||
|
||
|
||
const prefix = 'https://github.com/node-3d/segfault-raub/releases/download'; | ||
const tag = '2.3.0'; | ||
|
||
|
||
describe('AT / Install', async () => { | ||
const status = await install(`${prefix}/${tag}`); | ||
|
||
it('status is true', () => { | ||
assert.strictEqual(status, true); | ||
}); | ||
|
||
it('platform folder exists', async () => { | ||
const isFolderCreated = await exists(`${__dirname}/../${getBin()}`); | ||
assert.strictEqual(isFolderCreated, true); | ||
}); | ||
|
||
it('platform binary exists', async () => { | ||
const isAddonAvailable = await exists(`${__dirname}/../${getBin()}/segfault.node`); | ||
assert.strictEqual(isAddonAvailable, true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters