
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@abetomo/simply-imitated-sqs
Advanced tools
Simply imitated SQS for testing
Simple SQS class that can be used for local test. You do not even need to use Docker.
You can send, receive and delete data, so you can do better unit tests than with mocks.
% npm install -D @abetomo/simply-imitated-sqs
sqs instance// !!!
// If the value of the environment variable LOCAL_TEST is set,
// it will be tested with SimplyImitatedSQS
import AWS from 'aws-sdk'
import SimplyImitatedSQS from '@abetomo/simply-imitated-sqs'
const sqs = (() => {
// !!! If environment variable is set, use SimplyImitatedSQS
if (process.env.LOCAL_TEST === '1') {
return new SimplyImitatedSQS()
}
return new AWS.SQS({
region: 'us-east-1',
apiVersion: '2012-11-05'
})
})()
//
// do something
//
// !!!
// If the value of the environment variable LOCAL_TEST is set,
// it will be tested with SimplyImitatedSQS
//
import AWS from 'aws-sdk'
import { Server } from '@abetomo/simply-imitated-sqs'
const sqs = new AWS.SQS({
region: 'us-east-1',
apiVersion: '2012-11-05'
})
// Existing code remains the same except booting the server
// and reassigning the `queueUrl`.
const server = new Server()
let queueUrl = 'https://sqs.us-east-1.amazonaws.com/xxx/test'
if (process.env.LOCAL_TEST === '1') {
/// !!! Server start and `queueUrl` reassignment
queueUrl = server.run({
port: '1234',
host: 'localhost'
})
}
// sendMessage
try {
const params = {
QueueUrl: queueUrl,
MessageBody: 'hoge' + (new Date()).toString()
}
const res = await sqs.sendMessage(params).promise()
console.log('+++\n%s\n+++', JSON.stringify(res, null, ' '))
} catch (err) {
console.error(err)
}
//
// do something
//
if (process.env.LOCAL_TEST === '1') {
// !!! Finally shutdown the server
console.log('server shutdown')
server.close()
}
# Access AWS.
% node example.js
# Local Completion Test
% LOCAL_TEST=1 node example.js
FAQs
Simply imitated SQS for testing
The npm package @abetomo/simply-imitated-sqs receives a total of 130 weekly downloads. As such, @abetomo/simply-imitated-sqs popularity was classified as not popular.
We found that @abetomo/simply-imitated-sqs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.