
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@line/liff-mock
Advanced tools
LIFF Mock is a LIFF Plugin that make testing your LIFF app easy.
※ LIFF Plugin feature is available since LIFF SDK v2.19.0.
$ npm install @line/liff-mock
import liff from '@line/liff';
import { LiffMockPlugin } from '@line/liff-mock';
liff.use(new LiffMockPlugin());
liff.init({
liffId: 'liff-xxxx',
mock: true, // enable mock mode
});
if (!liff.isInClient()) liff.login();
const profile = await liff.getProfile();
// { displayName: 'Brown', userId: '123456789', statusMessage: 'hello' }
console.log(profile);
https://unpkg.com/@line/liff-mock@1.0.3/dist/umd/liff-mock.js
<!-- in <head> tag -->
<script src="https://unpkg.com/@line/liff-mock@1.0.3/dist/umd/liff-mock.js"></script>
const liff = window.liff;
const liffMockPlugin = window.liffMock;
liff.use(new LiffMockPlugin());
liff.init({
liffId: 'liff-xxxx',
mock: true, // enable mock mode
});
if (!liff.isInClient()) liff.login();
const profile = await liff.getProfile();
// { displayName: 'Brown', userId: '123456789', statusMessage: 'hello' }
console.log(profile);
Set mock data
type set = (
data: Partial<MockData> | ((prev: Partial<MockData>) => Partial<MockData>)
) => void;
const profile = await liff.getProfile();
// { displayName: 'Brown', userId: '123456789', statusMessage: 'hello' }
console.log(profile);
liff.$mock.set((p) => ({
...p,
getProfile: { displayName: 'Cony', userId: '1111111' },
}));
const profile = await liff.getProfile();
// { displayName: 'Cony', userId: '1111111' }
console.log(profile);
Restore default mock data
type clear: () => void;
// liff.$mock.set(...)
const profile = await liff.getProfile();
// { displayName: 'Cony', userId: '1111111' }
console.log(profile);
liff.$mock.clear();
const profile = await liff.getProfile();
// { displayName: 'Brown', userId: '123456789', statusMessage: 'hello' }
console.log(profile);
See examples
$ nvm use
$ npm ci
FAQs
Make testing your LIFF app easy
The npm package @line/liff-mock receives a total of 0 weekly downloads. As such, @line/liff-mock popularity was classified as not popular.
We found that @line/liff-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.