-
Notifications
You must be signed in to change notification settings - Fork 117
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
4 changed files
with
71 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
|
||
mkdir -p ./tmp | ||
npm pack | ||
mv *.tgz ./tmp | ||
tar xvzf tmp/*.tgz -C ./tmp | ||
|
||
exit 0 |
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,13 @@ | ||
#!/bin/bash | ||
set -e | ||
set -o pipefail | ||
|
||
echo 'Testing Package for publishing...' | ||
./node_modules/.bin/tape ./test/publish.js | ||
|
||
echo 'Attempting npm publish...' | ||
npm publish | ||
|
||
echo 'Success' | ||
|
||
exit 0 |
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,33 @@ | ||
'use strict'; | ||
|
||
var test = require('tape'); | ||
var exec = require('child_process').exec; | ||
|
||
function cleanUp(cb) { | ||
return exec('rm -rf ./tmp', cb); | ||
} | ||
|
||
function makeTestPackage(cb) { | ||
return exec('./scripts/mockPublish', cb); | ||
} | ||
|
||
// with regards to averting npm publishing disasters https://github.com/floridoo/gulp-sourcemaps/issues/246 | ||
test('publish: can load a published version', function(t) { | ||
// return t.fail("mock fail"); | ||
cleanUp(function() { | ||
makeTestPackage(function() { | ||
try { | ||
// attempt to load a packed / unpacked potential deployed version | ||
require('../tmp/package/index'); | ||
} | ||
catch (error){ | ||
t.fail(error); | ||
} | ||
finally{ | ||
cleanUp(function() { | ||
t.end(); | ||
}); | ||
} | ||
}); | ||
}); | ||
}); |