Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliytv committed Aug 22, 2022
1 parent 8f82a52 commit c3e8b2d
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "smsc",
"version": "1.0.4",
"version": "1.0.5",
"description": "SMSC.ru api",
"type": "module",
"main": "./src/index.js",
Expand All @@ -10,7 +10,7 @@
"scripts": {
"standard": "npx standard --fix",
"fix": "npx standard --fix && npx prettier --write .",
"test": "NODE_OPTIONS=--experimental-vm-modules npx jest --setupFiles dotenv-flow/config"
"test": "env $(cat .env) npx coverage-node test/index.js"
},
"keywords": [
"smsc",
Expand All @@ -28,7 +28,7 @@
"homepage": "https://github.com/nitra/smsc#readme",
"devDependencies": {
"@nitra/prettier-config": "^1.0.0",
"dotenv-flow": "^3.2.0"
"test-director": "10.0.0"
},
"prettier": "@nitra/prettier-config",
"dependencies": {
Expand Down
17 changes: 17 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { sendSms } from '../src/index.js'
import { equal } from 'node:assert'
import TestDirector from 'test-director'

const tests = new TestDirector()

tests.add('success', async () => {
const data = await sendSms('+37120128611', 'npm тест')
equal(data.cnt, 1)
})

tests.add('failure', async () => {
const data = await sendSms('000', 'тест')
equal(data.error_code, 1)
})

tests.run()
12 changes: 0 additions & 12 deletions test/smsc.test.js

This file was deleted.

30 changes: 18 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,28 @@
resolved "https://registry.yarnpkg.com/@nitra/prettier-config/-/prettier-config-1.0.0.tgz#f45519d5f85820b2c45981865b13ff4d360e4c0f"
integrity sha512-r/o48pk3Dnne/xQXXUd8Rv2fwNCvTZqT9DroiyFiLDty6tq36i/QaskBJsrv/GuYNKI07jeSN5mAVoxzOqvz4g==

"@types/node@*":
version "18.7.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.9.tgz#180bfc495c91dc62573967edf047e15dbdce1491"
integrity sha512-0N5Y1XAdcl865nDdjbO0m3T6FdmQ4ijE89/urOHLREyTXbpMWbSafx9y7XIsgWGtwUP2iYTinLyyW3FatAxBLQ==

data-uri-to-buffer@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-3.0.1.tgz#594b8973938c5bc2c33046535785341abc4f3636"
integrity sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==

dotenv-flow@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/dotenv-flow/-/dotenv-flow-3.2.0.tgz#a5d79dd60ddb6843d457a4874aaf122cf659a8b7"
integrity sha512-GEB6RrR4AbqDJvNSFrYHqZ33IKKbzkvLYiD5eo4+9aFXr4Y4G+QaFrB/fNp0y6McWBmvaPn3ZNjIufnj8irCtg==
dependencies:
dotenv "^8.0.0"

dotenv@^8.0.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==

fetch-blob@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.2.tgz#6bc438675f3851ecea51758ac91f6a1cd1bacabd"
integrity sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==
dependencies:
web-streams-polyfill "^3.0.3"

kleur@^4.1.5:
version "4.1.5"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-4.1.5.tgz#95106101795f7050c6c650f350c683febddb1780"
integrity sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==

node-fetch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.0.0.tgz#79da7146a520036f2c5f644e4a26095f17e411ea"
Expand All @@ -44,6 +42,14 @@ node-fetch@^3.0.0:
data-uri-to-buffer "^3.0.1"
fetch-blob "^3.1.2"

test-director@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/test-director/-/test-director-10.0.0.tgz#2b876724d28c5cba29a5b559edcb8925e01a8755"
integrity sha512-Txu/WJ+ULqEt+uAJDsZx3MRmjdMhQh3AsmUWLhQW5DRYvfqBi1IDWxQ+a7lDpZgT7Ky0J1l6jlSK8Q0zzc9UsQ==
dependencies:
"@types/node" "*"
kleur "^4.1.5"

web-streams-polyfill@^3.0.3:
version "3.1.1"
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz#1516f2d4ea8f1bdbfed15eb65cb2df87098c8364"
Expand Down

0 comments on commit c3e8b2d

Please sign in to comment.